
    x
h[                     T   d dl mZ d dlmZ d dlmZ  G d dej                        Z ej                  e      Z	 G d dej                        Z
 ej                  e
      Z G d d	ej                        Z ej                  e      Z G d
 dej                        Z ej                  e      Z G d dej                         Z ej                   e      Z G d dej                        Z ej                  e      Z G d dej                         Z ej                   e      Z G d dej                        Z ej                  e      Z G d dej                         Z ej                   e      Z G d dej                         Z ej                   e      Zee_        ee_         ej>                         e_         ej:                  ej<                  ej@                  de_!         ed      e_"         ej>                         e
_#         ej>                         e
_$         ej>                         e
_%         ej>                         e
_&         ej>                         e
_'        ee
_(         ej>                         e
_)         ej>                         e
_         e
jF                  e
jH                  e
jJ                  e
jL                  e
jN                  e
jP                  e
jR                  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j>                         e_0         ej>                         e_1         ej>                         e_         ej`                  ejb                  ej@                  d!e_!         ed"      e_2         ed#      e_3         ed      e_"         ej>                         e_4         ej>                         e_5         ej>                         e_         ejh                  ejj                  ej@                  d$e_!         ed%      e_6         ed&      e_7         ed      e_"        eejp                  _9         ejt                         ejv                  _9         e<d'd(g      e_=        d'ejp                  jr                  fd(ejv                  jr                  fge_>         ej>                         e_?         ej>                         e_@         ej>                         e_         ej~                  ej                  ej@                  d)e_!         ed*      e_A         ed+      e_B         ed      e_"         ej                  d,-      ej                  _9         ej                  d,-      ej                  _9         e<d.d/g      e_=        d.ej                  jr                  fd/ej                  jr                  fge_>         ej>                         e_F         ej>                         e_G         ej>                         e_         ej                  ej                  ej@                  d0e_!         ed1      e_H         ed2      e_I         ed      e_"         ej                  d,-      ej                  _9         e<d3g      e_=        d3ej                  jr                  fge_>         ej                         ej                  _9         e<d4g      e_=        d4ej                  jr                  fge_>        d,ejv                  _L         ej                  d5d,d6eeed7d8d9d:      ZN ej                  d;d,d< ej>                          ej>                          ej>                         d=d8d9d:      ZOeNeOd>ZPy?)@    )unicode_literals)
stone_base)stone_validatorsc                   h     e Zd ZdZdZdZed        Zed        Zd Z	d Z
d Zd	 Zd
 Z fdZ x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                      | 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vals     Q/var/www/html/lionshead-backend/venv/lib/python3.12/site-packages/dropbox/auth.pyr
   z AccessError.invalid_account_type   s     )3//    c                      | d|      S )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   s     r   r   zAccessError.paper_access_denied(   s     (#..r   c                      | j                   dk(  S )z[
        Check if the union tag is ``invalid_account_type``.

        :rtype: bool
        r
   _tagselfs    r   is_invalid_account_typez#AccessError.is_invalid_account_type3        yy222r   c                      | j                   dk(  S )zZ
        Check if the union tag is ``paper_access_denied``.

        :rtype: bool
        r   r   r   s    r   is_paper_access_deniedz"AccessError.is_paper_access_denied;        yy111r   c                      | j                   dk(  S zL
        Check if the union tag is ``other``.

        :rtype: bool
        r   r   r   s    r   is_otherzAccessError.is_otherC        yyG##r   c                 P    | j                         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   s    r   get_invalid_account_typez$AccessError.get_invalid_account_typeK   s&     ++- !EFF{{r   c                 P    | j                         st        d      | j                  S )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   s    r   get_paper_access_deniedz#AccessError.get_paper_access_deniedW   s&     **, !DEE{{r   c                 0    t         t        |   |||       y N)superr   _process_custom_annotationsr   annotation_type
field_path	processor	__class__s       r   r*   z'AccessError._process_custom_annotationsc   s    k4<_jZcdr   )__name__
__module____qualname____doc__
_catch_allr   classmethodr
   r   r   r   r   r$   r&   r*   __classcell__r/   s   @r   r   r   
   s_     JE0 0 / /32$

e er   r   c                        e Zd ZdZdZdZdZdZdZdZ	dZ
dZed        Zd Zd Zd Zd Zd	 Zd
 Zd Zd Zd Z fdZ x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                      | d|      S )z
        Create an instance of this class set to the ``missing_scope`` tag with
        value ``val``.

        :param TokenScopeError val:
        :rtype: AuthError
        missing_scoper   r   s     r   r;   zAuthError.missing_scope   s     ?C((r   c                      | j                   dk(  S )z[
        Check if the union tag is ``invalid_access_token``.

        :rtype: bool
        invalid_access_tokenr   r   s    r   is_invalid_access_tokenz!AuthError.is_invalid_access_token   r   r   c                      | j                   dk(  S )zZ
        Check if the union tag is ``invalid_select_user``.

        :rtype: bool
        invalid_select_userr   r   s    r   is_invalid_select_userz AuthError.is_invalid_select_user   r   r   c                      | j                   dk(  S )z[
        Check if the union tag is ``invalid_select_admin``.

        :rtype: bool
        invalid_select_adminr   r   s    r   is_invalid_select_adminz!AuthError.is_invalid_select_admin   r   r   c                      | j                   dk(  S )zU
        Check if the union tag is ``user_suspended``.

        :rtype: bool
        user_suspendedr   r   s    r   is_user_suspendedzAuthError.is_user_suspended        yy,,,r   c                      | j                   dk(  S )z[
        Check if the union tag is ``expired_access_token``.

        :rtype: bool
        expired_access_tokenr   r   s    r   is_expired_access_tokenz!AuthError.is_expired_access_token   r   r   c                      | j                   dk(  S )zT
        Check if the union tag is ``missing_scope``.

        :rtype: bool
        r;   r   r   s    r   is_missing_scopezAuthError.is_missing_scope   s     yyO++r   c                      | j                   dk(  S )zZ
        Check if the union tag is ``route_access_denied``.

        :rtype: bool
        route_access_deniedr   r   s    r   is_route_access_deniedz AuthError.is_route_access_denied   r   r   c                      | j                   dk(  S r   r   r   s    r   r   zAuthError.is_other   r    r   c                 P    | j                         st        d      | j                  S )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)rM   r"   r#   r   s    r   get_missing_scopezAuthError.get_missing_scope   s&     $$& !>??{{r   c                 0    t         t        |   |||       y r(   )r)   r9   r*   r+   s       r   r*   z%AuthError._process_custom_annotations   s    i:?JXabr   )r0   r1   r2   r3   r4   r=   r@   rC   rF   rJ   rO   r   r5   r;   r>   rA   rD   rG   rK   rM   rP   r   rS   r*   r6   r7   s   @r   r9   r9   h   s    ( JNE) )323-3,2$
c cr   r9   c                   D     e Zd ZdZdZdZdZdZd Zd Z	d Z
 fdZ x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                      | j                   dk(  S )zO
        Check if the union tag is ``endpoint``.

        :rtype: bool
        endpointr   r   s    r   is_endpointz#InvalidAccountTypeError.is_endpoint   s     yyJ&&r   c                      | j                   dk(  S )zN
        Check if the union tag is ``feature``.

        :rtype: bool
        featurer   r   s    r   
is_featurez"InvalidAccountTypeError.is_feature  s     yyI%%r   c                      | j                   dk(  S r   r   r   s    r   r   z InvalidAccountTypeError.is_other  r    r   c                 0    t         t        |   |||       y r(   )r)   rV   r*   r+   s       r   r*   z3InvalidAccountTypeError._process_custom_annotations  s    %tHZdfopr   )r0   r1   r2   r3   r4   rX   r[   r   rY   r\   r   r*   r6   r7   s   @r   rV   rV      s9    	 JHGE'&$q qr   rV   c                   D     e Zd ZdZdZdZdZdZd Zd Z	d Z
 fdZ xZS )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                      | j                   dk(  S )zU
        Check if the union tag is ``paper_disabled``.

        :rtype: bool
        paper_disabledr   r   s    r   is_paper_disabledz"PaperAccessError.is_paper_disabled-  rH   r   c                      | j                   dk(  S )zU
        Check if the union tag is ``not_paper_user``.

        :rtype: bool
        not_paper_userr   r   s    r   is_not_paper_userz"PaperAccessError.is_not_paper_user5  rH   r   c                      | j                   dk(  S r   r   r   s    r   r   zPaperAccessError.is_other=  r    r   c                 0    t         t        |   |||       y r(   )r)   r`   r*   r+   s       r   r*   z,PaperAccessError._process_custom_annotationsE  s    A/S]_hir   )r0   r1   r2   r3   r4   rb   re   r   rc   rf   r   r*   r6   r7   s   @r   r`   r`     s9     JNNE--$j jr   r`   c                        e Zd ZdZddgZdZ	 	 d
dZ ej                  dd      Z	 ej                  d      Z
 fd	Z x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_valueTc                 ~    t         j                  | _        t         j                  | _        ||| _        ||| _        y y r(   )bbNOT_SETrk   rl   reasonretry_after)r   rp   rq   s      r   __init__zRateLimitError.__init__[  s<      ZZ"$** DK"*D #r   rp   )user_definedrq   c                 0    t         t        |   |||       y r(   )r)   rj   r*   r+   s       r   r*   z*RateLimitError._process_custom_annotationsk  s    nd?Q[]fgr   NN)r0   r1   r2   r3   	__slots___has_required_fieldsrr   rn   	Attributerp   rq   r*   r6   r7   s   @r   rj   rj   J  s^     	I
   !+ R\\(6F ",,}-Kh hr   rj   c                   D     e Zd ZdZdZdZdZdZd Zd Z	d Z
 fdZ xZS )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                      | j                   dk(  S )zX
        Check if the union tag is ``too_many_requests``.

        :rtype: bool
        too_many_requestsr   r   s    r   is_too_many_requestsz$RateLimitReason.is_too_many_requests  s     yy///r   c                      | j                   dk(  S )z`
        Check if the union tag is ``too_many_write_operations``.

        :rtype: bool
        too_many_write_operationsr   r   s    r   is_too_many_write_operationsz,RateLimitReason.is_too_many_write_operations       yy777r   c                      | j                   dk(  S r   r   r   s    r   r   zRateLimitReason.is_other  r    r   c                 0    t         t        |   |||       y r(   )r)   rz   r*   r+   s       r   r*   z+RateLimitReason._process_custom_annotations      ot@R\^ghr   )r0   r1   r2   r3   r4   r|   r   r   r}   r   r   r*   r6   r7   s   @r   rz   rz   p  s;    	 J $E08$i ir   rz   c                        e Zd ZdZddgZdZ	 	 d	dZ ej                  d      Z	 ej                  d      Z
 fdZ x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_valueTc                 ~    t         j                  | _        t         j                  | _        ||| _        ||| _        y y r(   )rn   ro   r   r   oauth1_tokenoauth1_token_secret)r   r   r   s      r   rr   zTokenFromOAuth1Arg.__init__  s=     $&:: *,**'# ,D*':D$ +r   r   r   c                 0    t         t        |   |||       y r(   )r)   r   r*   r+   s       r   r*   z.TokenFromOAuth1Arg._process_custom_annotations  s     $COU_ajkr   ru   )r0   r1   r2   r3   rv   rw   rr   rn   rx   r   r   r*   r6   r7   s   @r   r   r     s^     	$I
   #%);  2<</L '",,'<=l lr   r   c                   D     e Zd ZdZdZdZdZdZd Zd Z	d Z
 fdZ xZS )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                      | j                   dk(  S )z`
        Check if the union tag is ``invalid_oauth1_token_info``.

        :rtype: bool
        invalid_oauth1_token_infor   r   s    r   is_invalid_oauth1_token_infoz1TokenFromOAuth1Error.is_invalid_oauth1_token_info  r   r   c                      | j                   dk(  S )zV
        Check if the union tag is ``app_id_mismatch``.

        :rtype: bool
        app_id_mismatchr   r   s    r   is_app_id_mismatchz'TokenFromOAuth1Error.is_app_id_mismatch  s     yy---r   c                      | j                   dk(  S r   r   r   s    r   r   zTokenFromOAuth1Error.is_other  r    r   c                 0    t         t        |   |||       y r(   )r)   r   r*   r+   s       r   r*   z0TokenFromOAuth1Error._process_custom_annotations  s    "DEoWaclmr   )r0   r1   r2   r3   r4   r   r   r   r   r   r   r*   r6   r7   s   @r   r   r     s:    	 J $OE8.$n nr   r   c                   Z     e Zd ZdZdgZdZ	 ddZ ej                  d      Z	 fdZ
 xZS )TokenFromOAuth1Resultz
    :ivar auth.TokenFromOAuth1Result.oauth2_token: The OAuth 2.0 token generated
        from the supplied OAuth 1.0 token.
    _oauth2_token_valueTc                 B    t         j                  | _        ||| _        y y r(   )rn   ro   r   oauth2_token)r   r   s     r   rr   zTokenFromOAuth1Result.__init__  s!    #%:: # ,D $r   r   c                 0    t         t        |   |||       y r(   )r)   r   r*   r+   s       r   r*   z1TokenFromOAuth1Result._process_custom_annotations  s    #TFXbdmnr   r(   )r0   r1   r2   r3   rv   rw   rr   rn   rx   r   r*   r6   r7   s   @r   r   r     sD     	I   #-  2<</Lo or   r   c                   Z     e Zd ZdZdgZdZ	 ddZ ej                  d      Z	 fdZ
 xZS )TokenScopeErrorzd
    :ivar auth.TokenScopeError.required_scope: The required scope to access the
        route.
    _required_scope_valueTc                 B    t         j                  | _        ||| _        y y r(   )rn   ro   r   required_scope)r   r   s     r   rr   zTokenScopeError.__init__  s!    %'ZZ"%"0D &r   r   c                 0    t         t        |   |||       y r(   )r)   r   r*   r+   s       r   r*   z+TokenScopeError._process_custom_annotations%  r   r   r(   )r0   r1   r2   r3   rv   rw   rr   rn   rx   r   r*   r6   r7   s   @r   r   r     sE     	 I   !%1 "R\\"23Ni ir   r   )r
   r   r   r   )r=   r@   rC   rF   rJ   r;   rO   r   r=   r@   rC   rF   rJ   rO   )rX   r[   r   rX   r[   )rb   re   r   rb   re   rp   rq   )r|   r   r   r|   r      )
min_lengthr   r   )r   r   r   r   r   r   r   token/from_oauth1Tappapirpc)authhoststyletoken/revokeFuser)r   r   N)Q
__future__r   stone.backends.python_rsrcr   rn   r   bvUnionr   AccessError_validatorr9   AuthError_validatorrV   !InvalidAccountTypeError_validatorr`   PaperAccessError_validatorStructrj   RateLimitError_validatorrz   RateLimitReason_validatorr   TokenFromOAuth1Arg_validatorr   TokenFromOAuth1Error_validatorr   TokenFromOAuth1Result_validatorr   TokenScopeError_validator_invalid_account_type_validator_paper_access_denied_validatorVoid_other_validator_tagmapr   _invalid_access_token_validator_invalid_select_user_validator_invalid_select_admin_validator_user_suspended_validator_expired_access_token_validator_missing_scope_validator_route_access_denied_validatorr=   r@   rC   rF   rJ   rO   _endpoint_validator_feature_validatorrX   r[   _paper_disabled_validator_not_paper_user_validatorrb   re   rp   	validatorUInt64rq   set_all_field_names__all_fields__too_many_requests_validator$_too_many_write_operations_validatorr|   r   Stringr   r   $_invalid_oauth1_token_info_validator_app_id_mismatch_validatorr   r   r   r   defaultRoutetoken_from_oauth1token_revokeROUTESr   r   r   <module>r      sD   ( 7 =Ze"(( Zex !- }c }c~ bhhy) -qbhh -q^ %-BHH-D$E !,jrxx ,j\ &RXX&67 "hRYY "hH %299^4 -ibhh -i^ %BHH_5  l  lD  )ryy);< -n288 -n^ "**>!? oBII o0 #,")),A"B ibii i0 &BIIo6 .O +-G *&rwwy 'GG&EE))   ( ,3BGGI	 )+22779	 (,3BGGI	 )&-bggi	 #,3BGGI	 )%>	 "+22779	 ($RWWY	 %EE$CC%EE99%EE77$CC''		  "++A!B	  )*? @	 !*+A!B	 $%56	 !*+A!B	  )*? @	 G$	.5bggi  +-4RWWY  *+22779  (';;&99$55#   $;:#F   "9)"D   7 @  -4RWWY  *-4RWWY  *$+BGGI  !&@@&@@..   #33C"D  "23C"D  )'2  ";   '0ryy{   $#&( $  
 ~$$../N..889 
 07rwwy ,7>rwwy 4#*2779  (EE!0!U!U--  %44G$H !,;<W,X )'0 ,5BII,C    )3<2993J  & & 0'*, (  $
 '44>>?.BBLLM#  
 =DBGGI  929"'')  /(/	  %!5!Z!Z+FF!22    2FFa1b  .';<M'N  $1':  /8ryyA/F  " " ,*-~.>*?  ''57L7Y7Y7c7c&d%e  "+4299;   ($')9(:$; !!1?3Q3Q3[3[ \] %&   "BHH #"
  rxx	BGGIBGGIBGGI
 + 
r   