
    x
h.                     2   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      Z ej                  e      Z G d de      Z ej                  e      Z ej(                  d      Z ej,                  d      Z ej,                         Z ej(                  d      Z ej,                  dd      Z ej,                  d      Z ej,                  ddd      Z ej,                  d      Z ej,                  dd      Z ej,                         ZeZ  ejB                         e_"        ee_#        ee_$         ejB                         e_%        ejD                  ejF                  ejH                  ejJ                  de_&         ed      e_'         ed      e_(        ee
_)         ejB                         e
_*         ejB                         e
_%        e
jR                  e
jT                  e
jJ                  de
_&         e
d      e
_+         e
d      e
_(        eejX                  _-        eej\                  _-         e/d d!g      e_0        ej`                  e_1        d ejX                  jZ                  fd!ej\                  jZ                  fge_2        ejd                  e_3        eed"e_4        ed#efed$efie_5        d%e_6         ej,                         ejn                  _-         e/d&g      e_0        ejb                  jq                  ej`                        e_1        d&ejn                  jZ                  fge_2        ejf                  ejd                  z   e_3         e/g       e_0        ejb                  jq                  ej`                        e_1        g e_2        ejf                  ejd                  z   e_3        i Z9y')(    )unicode_literals)
stone_base)stone_validatorsc                   r     e Zd 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d Z fdZ xZS )PathRoota  
    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 common.PathRoot.home: Paths are relative to the authenticating user's
        home namespace, whether or not that user belongs to a team.
    :ivar str common.PathRoot.root: Paths are relative to the authenticating
        user's root namespace (This results in
        :field:`PathRootError.invalid_root` if the user's root namespace has
        changed.).
    :ivar str common.PathRoot.namespace_id: Paths are relative to given
        namespace id (This results in :field:`PathRootError.no_permission` if
        you don't have access to this namespace.).
    otherNc                      | d|      S )z
        Create an instance of this class set to the ``root`` tag with value
        ``val``.

        :param str val:
        :rtype: PathRoot
        root clsvals     S/var/www/html/lionshead-backend/venv/lib/python3.12/site-packages/dropbox/common.pyr
   zPathRoot.root!   s     63    c                      | d|      S )z
        Create an instance of this class set to the ``namespace_id`` tag with
        value ``val``.

        :param str val:
        :rtype: PathRoot
        namespace_idr   r   s     r   r   zPathRoot.namespace_id,        >3''r   c                      | j                   dk(  S )zK
        Check if the union tag is ``home``.

        :rtype: bool
        home_tagselfs    r   is_homezPathRoot.is_home7        yyF""r   c                      | j                   dk(  S )zK
        Check if the union tag is ``root``.

        :rtype: bool
        r
   r   r   s    r   is_rootzPathRoot.is_root?   r   r   c                      | j                   dk(  S )zS
        Check if the union tag is ``namespace_id``.

        :rtype: bool
        r   r   r   s    r   is_namespace_idzPathRoot.is_namespace_idG        yyN**r   c                      | j                   dk(  S zL
        Check if the union tag is ``other``.

        :rtype: bool
        r   r   r   s    r   is_otherzPathRoot.is_otherO        yyG##r   c                 P    | j                         st        d      | j                  S )a  
        Paths are relative to the authenticating user's root namespace (This
        results in ``PathRootError.invalid_root`` if the user's root namespace
        has changed.).

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

        :rtype: str
        ztag 'root' not set)r   AttributeError_valuer   s    r   get_rootzPathRoot.get_rootW   s#     ||~ !566{{r   c                 P    | j                         st        d      | j                  S )z
        Paths are relative to given namespace id (This results in
        ``PathRootError.no_permission`` if you don't have access to this
        namespace.).

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

        :rtype: str
        ztag 'namespace_id' not set)r   r&   r'   r   s    r   get_namespace_idzPathRoot.get_namespace_ide   s&     ##% !=>>{{r   c                 0    t         t        |   |||       y N)superr   _process_custom_annotationsr   annotation_type
field_path	processor	__class__s       r   r.   z$PathRoot._process_custom_annotationss       h9/:W`ar   )__name__
__module____qualname____doc__
_catch_allr   r   classmethodr
   r   r   r   r   r#   r(   r*   r.   __classcell__r3   s   @r   r   r   
   si      JDE    ( (##+$b br   r   c                   V     e Zd ZdZdZdZdZed        Zd Z	d Z
d Zd Z fd	Z xZS )
PathRootErrora  
    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 RootInfo PathRootError.invalid_root: The root namespace id in
        Dropbox-API-Path-Root header is not valid. The value of this error is
        the user's latest root info.
    :ivar common.PathRootError.no_permission: You don't have permission to
        access the namespace id in Dropbox-API-Path-Root  header.
    r   Nc                      | d|      S )z
        Create an instance of this class set to the ``invalid_root`` tag with
        value ``val``.

        :param RootInfo val:
        :rtype: PathRootError
        invalid_rootr   r   s     r   r@   zPathRootError.invalid_root   r   r   c                      | j                   dk(  S )zS
        Check if the union tag is ``invalid_root``.

        :rtype: bool
        r@   r   r   s    r   is_invalid_rootzPathRootError.is_invalid_root   r    r   c                      | j                   dk(  S )zT
        Check if the union tag is ``no_permission``.

        :rtype: bool
        no_permissionr   r   s    r   is_no_permissionzPathRootError.is_no_permission   s     yyO++r   c                      | j                   dk(  S r"   r   r   s    r   r#   zPathRootError.is_other   r$   r   c                 P    | j                         st        d      | j                  S )z
        The root namespace id in Dropbox-API-Path-Root header is not valid. The
        value of this error is the user's latest root info.

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

        :rtype: RootInfo
        ztag 'invalid_root' not set)rB   r&   r'   r   s    r   get_invalid_rootzPathRootError.get_invalid_root   s&     ##% !=>>{{r   c                 0    t         t        |   |||       y r,   )r-   r>   r.   r/   s       r   r.   z)PathRootError._process_custom_annotations   s    mT>PZ\efr   )r5   r6   r7   r8   r9   rD   r   r:   r@   rB   rE   r#   rH   r.   r;   r<   s   @r   r>   r>   x   sK    
 JME( (+,$g gr   r>   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 )
RootInfoa  
    Information about current user's root.

    :ivar common.RootInfo.root_namespace_id: The namespace ID for user's root
        namespace. It will be the namespace ID of the shared team root if the
        user is member of a team with a separate team root. Otherwise it will be
        same as ``RootInfo.home_namespace_id``.
    :ivar common.RootInfo.home_namespace_id: The namespace ID for user's home
        namespace.
    _root_namespace_id_value_home_namespace_id_valueTc                 ~    t         j                  | _        t         j                  | _        ||| _        ||| _        y y r,   )bbNOT_SETrL   rM   root_namespace_idhome_namespace_id)r   rQ   rR   s      r   __init__zRootInfo.__init__   s=     )+

%(*

%(%6D"(%6D" )r   rQ   rR   c                 0    t         t        |   |||       y r,   )r-   rK   r.   r/   s       r   r.   z$RootInfo._process_custom_annotations   r4   r   NN)r5   r6   r7   r8   	__slots___has_required_fieldsrS   rO   	AttributerQ   rR   r.   r;   r<   s   @r   rK   rK      s`    	 	#"I
   $(#'7 %%89 %%89b br   rK   c                   b     e Zd ZdZdgZdZ	 	 	 d fd	Z ej                  d      Z	 fdZ
 xZS )TeamRootInfoz
    Root info when user is member of a team with a separate root namespace ID.

    :ivar common.TeamRootInfo.home_path: The path for user's home directory
        under the shared team root.
    _home_path_valueTc                 l    t         t        |   ||       t        j                  | _        ||| _        y y r,   )r-   rZ   rS   rO   rP   r[   	home_path)r   rQ   rR   r]   r3   s       r   rS   zTeamRootInfo.__init__   s8     	lD*+<+<	> "

 &DN !r   r]   c                 0    t         t        |   |||       y r,   )r-   rZ   r.   r/   s       r   r.   z(TeamRootInfo._process_custom_annotations      lD=oz[der   )NNN)r5   r6   r7   r8   rV   rW   rS   rO   rX   r]   r.   r;   r<   s   @r   rZ   rZ      sJ     	I   $(#'' [)If fr   rZ   c                   :     e Zd ZdZg ZdZ	 	 d fd	Z fdZ xZS )UserRootInfoz
    Root info when user is not member of a team or the user is a member of a
    team and the team does not have a separate root namespace.
    Tc                 .    t         t        |   ||       y r,   )r-   ra   rS   )r   rQ   rR   r3   s      r   rS   zUserRootInfo.__init__  s     	lD*+<+<	>r   c                 0    t         t        |   |||       y r,   )r-   ra   r.   r/   s       r   r.   z(UserRootInfo._process_custom_annotations  r_   r   rU   )	r5   r6   r7   r8   rV   rW   rS   r.   r;   r<   s   @r   ra   ra     s0    
I   $(#'>f fr   ra   z%Y-%m-%dz[^/:?*<>"|]*)patternz%Y-%m-%dT%H:%M:%SZ   zA^['#&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*\.[A-Za-z]{2,15}$)
max_lengthrd      )
min_length   d   )rh   rf   rd   z[-_0-9a-zA-Z:]+)r   r
   r   r   r   r   )r@   rD   r   rD   rQ   rR   )teamuserrk   rm   Tr]   N):
__future__r   stone.backends.python_rsrcr   rO   r   bvUnionr   PathRoot_validatorr>   PathRootError_validatorStructrK   
StructTreeRootInfo_validatorrZ   TeamRootInfo_validatorra   UserRootInfo_validator	TimestampDate_validatorStringDisplayName_validatorDisplayNameLegacy_validatorDropboxTimestamp_validatorEmailAddress_validatorLanguageCode_validatorNamePart_validatorNamespaceId_validatorOptionalNamePart_validatorSessionId_validatorSharedFolderId_validatorVoid_home_validator_root_validator_namespace_id_validator_other_validator_tagmapr   r   _invalid_root_validator_no_permission_validatorrD   rQ   	validatorrR   set_field_names__all_field_names__fields__all_fields__tag_to_subtype__pytype_to_tag_and_subtype__is_catch_all_r]   unionROUTESr   r   r   <module>r      s   ( 7 =jbrxx jbX RXXh' DgBHH DgL #"((=1 $bryy $bL #R]]8, f8 f< #<0 f8 f( #<0 j)!		.9 'biik )R\\*>? "c;  A "a0 RYY!^T !		*;< &RYY#~N biik 0 "2779 0 #8  #BGGI $$$$44&&	   '"(: %)0 &!( !99";;++  ,O< #G, '<   $'<   $   &33 (44>>?(44>>?  !))  &% 
 945945( $  #,299;     +/ !)!;!;!A!A,B\B\!] %|'='='G'GHI $11L4I4II  W !)!;!;!A!A,B\B\!]  $11L4I4II 
r   