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ZeeZG dd deZeeZedZejddZe ZedZejdddZejddZejddddZejddZejdddZe ZeZ e! e_"ee_#ee_$e! e_%ej"ej#ej$ej%de_&ede_'ede_(ee
_)e! e
_*e! e
_%e
j)e
j*e
j%de
_&e
de
_+e
de
_(eej,_-eej._-e/d d!ge_0ej0e_1d ej,j-fd!ej.j-fge_2ej2e_3eed"e_4ed#efed$efie_5d%e_6e ej7_-e/d&ge_0ej18ej0e_1d&ej7j-fge_2ej3ej2 e_3e/g e_0ej18ej0e_1g e_2ej3ej2 e_3i Z9d'S )(    )unicode_literals)
stone_base)stone_validatorsc                       st   e Zd 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dd Z fddZ  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                 C   
   | d|S )z
        Create an instance of this class set to the ``root`` tag with value
        ``val``.

        :param str val:
        :rtype: PathRoot
        root clsvalr	   r	   eC:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\dropbox/common.pyr   !      
	zPathRoot.rootc                 C   r   )z
        Create an instance of this class set to the ``namespace_id`` tag with
        value ``val``.

        :param str val:
        :rtype: PathRoot
        namespace_idr	   r
   r	   r	   r   r   ,   r   zPathRoot.namespace_idc                 C   
   | j dkS )zK
        Check if the union tag is ``home``.

        :rtype: bool
        homeZ_tagselfr	   r	   r   is_home7      
zPathRoot.is_homec                 C   r   )zK
        Check if the union tag is ``root``.

        :rtype: bool
        r   r   r   r	   r	   r   is_root?   r   zPathRoot.is_rootc                 C   r   )zS
        Check if the union tag is ``namespace_id``.

        :rtype: bool
        r   r   r   r	   r	   r   is_namespace_idG   r   zPathRoot.is_namespace_idc                 C   r   zL
        Check if the union tag is ``other``.

        :rtype: bool
        r   r   r   r	   r	   r   is_otherO   r   zPathRoot.is_otherc                 C      |   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   r	   r	   r   get_rootW      
zPathRoot.get_rootc                 C   r   )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   r	   r	   r   get_namespace_ide   r   zPathRoot.get_namespace_idc                       t t| ||| d S N)superr   _process_custom_annotationsr   Zannotation_typeZ
field_path	processor	__class__r	   r   r$   s      z$PathRoot._process_custom_annotations)__name__
__module____qualname____doc__
_catch_allr   r   classmethodr   r   r   r   r   r   r   r    r$   __classcell__r	   r	   r'   r   r   
   s     



r   c                       sX   e 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 fddZ  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                 C   r   )z
        Create an instance of this class set to the ``invalid_root`` tag with
        value ``val``.

        :param RootInfo val:
        :rtype: PathRootError
        invalid_rootr	   r
   r	   r	   r   r2      r   zPathRootError.invalid_rootc                 C   r   )zS
        Check if the union tag is ``invalid_root``.

        :rtype: bool
        r2   r   r   r	   r	   r   is_invalid_root   r   zPathRootError.is_invalid_rootc                 C   r   )zT
        Check if the union tag is ``no_permission``.

        :rtype: bool
        no_permissionr   r   r	   r	   r   is_no_permission   r   zPathRootError.is_no_permissionc                 C   r   r   r   r   r	   r	   r   r      r   zPathRootError.is_otherc                 C   r   )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)r3   r   r   r   r	   r	   r   get_invalid_root   s   	zPathRootError.get_invalid_rootc                    r!   r"   )r#   r1   r$   r%   r'   r	   r   r$      r)   z)PathRootError._process_custom_annotations)r*   r+   r,   r-   r.   r4   r   r/   r2   r3   r5   r   r6   r$   r0   r	   r	   r'   r   r1   x   s    

r1   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 )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_valueTNc                 C   s4   t j| _t j| _|d ur|| _|d ur|| _d S d S r"   )bbNOT_SETr8   r9   root_namespace_idhome_namespace_idr   r<   r=   r	   r	   r   __init__   s   
zRootInfo.__init__r<   r=   c                    r!   r"   )r#   r7   r$   r%   r'   r	   r   r$      r)   z$RootInfo._process_custom_annotationsNN)r*   r+   r,   r-   	__slots___has_required_fieldsr?   r:   	Attributer<   r=   r$   r0   r	   r	   r'   r   r7      s    


r7   c                       sH   e Zd ZdZdgZdZ			d
 fdd	ZedZ	 fdd	Z
  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_valueTNc                    s0   t t| || tj| _|d ur|| _d S d S r"   )r#   rD   r?   r:   r;   rE   	home_path)r   r<   r=   rF   r'   r	   r   r?      s   
zTeamRootInfo.__init__rF   c                    r!   r"   )r#   rD   r$   r%   r'   r	   r   r$     r)   z(TeamRootInfo._process_custom_annotations)NNN)r*   r+   r,   r-   rA   rB   r?   r:   rC   rF   r$   r0   r	   r	   r'   r   rD      s    
rD   c                       s:   e Zd ZdZg ZdZ		d fdd	Z fddZ  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.
    TNc                    s   t t| || d S r"   )r#   rG   r?   r>   r'   r	   r   r?     s   zUserRootInfo.__init__c                    r!   r"   )r#   rG   r$   r%   r'   r	   r   r$     r)   z(UserRootInfo._process_custom_annotationsr@   )	r*   r+   r,   r-   rA   rB   r?   r$   r0   r	   r	   r'   r   rG     s    rG   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_lengthrH      )
min_length   d   )rL   rJ   rH   z[-_0-9a-zA-Z:]+)r   r   r   r   r   r   )r2   r4   r   r4   r<   r=   )ZteamuserrO   rP   TrF   N):
__future__r   Zstone.backends.python_rsrcr   r:   r   ZbvUnionr   ZPathRoot_validatorr1   ZPathRootError_validatorStructr7   Z
StructTreeZRootInfo_validatorrD   ZTeamRootInfo_validatorrG   ZUserRootInfo_validator	TimestampZDate_validatorStringZDisplayName_validatorZDisplayNameLegacy_validatorZDropboxTimestamp_validatorZEmailAddress_validatorZLanguageCode_validatorZNamePart_validatorZNamespaceId_validatorZOptionalNamePart_validatorZSessionId_validatorZSharedFolderId_validatorZVoidZ_home_validatorZ_root_validatorZ_namespace_id_validatorZ_other_validatorZ_tagmapr   r   Z_invalid_root_validatorZ_no_permission_validatorr4   r<   	validatorr=   setZ_field_names_Z_all_field_names__fields_Z_all_fields_Z_tag_to_subtype_Z_pytype_to_tag_and_subtype_Z_is_catch_all_rF   unionZROUTESr	   r	   r	   r   <module>   s   
l
F
&














