U
    ZfO1                     @   s  d dl mZ 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e Ze ZejddZe 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
de
_$e
de
_%e ej&_'eej(_'e)eej*_'e)e+ ej,_'eej-_'e.dddddge_/dej&j'fdej(j'fdej*j'fdej,j'fdej-j'fge_0e e_1e e_e e_ ej1ejej de_!ede_2ede_"ede_%e e_3e e_4e e_5e e_ ej3ej4ej5ej de_!ede_6ede_7ed e_8ede_%e)ej9ej:_'e)ej9ej;_'e.d!d"ge_/d!ej:j'fd"ej;j'fge_0i Z<d#S )$    )unicode_literals)
stone_base)stone_validators)commonc                       sT   e Zd ZdZdZdZdZdZdZdd Z	dd Z
dd	 Zd
d Z fddZ  ZS )GroupManagementTypeaO  
    The group type determines how a group is managed.

    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 team_common.GroupManagementType.user_managed: A group which is managed
        by selected users.
    :ivar team_common.GroupManagementType.company_managed: A group which is
        managed by team admins only.
    :ivar team_common.GroupManagementType.system_managed: A group which is
        managed automatically by Dropbox.
    otherNc                 C   s
   | j dkS zS
        Check if the union tag is ``user_managed``.

        :rtype: bool
        user_managedZ_tagself r   7/tmp/pip-unpacked-wheel-qnjxxdf1/dropbox/team_common.pyis_user_managed&   s    z#GroupManagementType.is_user_managedc                 C   s
   | j dkS )zV
        Check if the union tag is ``company_managed``.

        :rtype: bool
        company_managedr
   r   r   r   r   is_company_managed.   s    z&GroupManagementType.is_company_managedc                 C   s
   | j dkS )zU
        Check if the union tag is ``system_managed``.

        :rtype: bool
        system_managedr
   r   r   r   r   is_system_managed6   s    z%GroupManagementType.is_system_managedc                 C   s
   | j dkS zL
        Check if the union tag is ``other``.

        :rtype: bool
        r   r
   r   r   r   r   is_other>   s    zGroupManagementType.is_otherc                    s   t t| ||| d S N)superr   _process_custom_annotationsr   Zannotation_typeZ
field_path	processor	__class__r   r   r   F   s    z/GroupManagementType._process_custom_annotations)__name__
__module____qualname____doc__
_catch_allr	   r   r   r   r   r   r   r   r   __classcell__r   r   r   r   r      s   r   c                       sz   e Zd ZdZdddddgZdZdd	d
ZedZ	edZ
ejdddZejdddZejdddZ fddZ  ZS )GroupSummaryay  
    Information about a group.

    :ivar team_common.GroupSummary.group_external_id: External ID of group. This
        is an arbitrary ID that an admin can attach to a group.
    :ivar team_common.GroupSummary.member_count: The number of members in the
        group.
    :ivar team_common.GroupSummary.group_management_type: Who is allowed to
        manage the group.
    _group_name_value_group_id_value_group_external_id_value_member_count_value_group_management_type_valueTNc                 C   sr   t j| _t j| _t j| _t j| _t j| _|d k	r6|| _|d k	rD|| _|d k	rR|| _	|d k	r`|| _
|d k	rn|| _d S r   )bbNOT_SETr$   r%   r&   r'   r(   
group_namegroup_idgroup_external_idmember_countgroup_management_type)r   r+   r,   r/   r-   r.   r   r   r   __init__a   s    zGroupSummary.__init__r+   r,   r-   Znullabler.   r/   )Zuser_definedc                    s   t t| ||| d S r   )r   r#   r   r   r   r   r   r      s    z(GroupSummary._process_custom_annotations)NNNNN)r   r   r   r    	__slots___has_required_fieldsr0   r)   	Attributer+   r,   r-   r.   r/   r   r"   r   r   r   r   r#   K   s(        


r#   c                       sH   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 )	GroupTypea  
    The group type determines how a group is created and managed.

    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 team_common.GroupType.team: A group to which team members are
        automatically added. Applicable to `team folders
        <https://www.dropbox.com/help/986>`_ only.
    :ivar team_common.GroupType.user_managed: A group is created and managed by
        a user.
    r   Nc                 C   s
   | j dkS )zK
        Check if the union tag is ``team``.

        :rtype: bool
        teamr
   r   r   r   r   is_team   s    zGroupType.is_teamc                 C   s
   | j dkS r   r
   r   r   r   r   r      s    zGroupType.is_user_managedc                 C   s
   | j dkS r   r
   r   r   r   r   r      s    zGroupType.is_otherc                    s   t t| ||| d S r   )r   r5   r   r   r   r   r   r      s    z%GroupType._process_custom_annotations)r   r   r   r    r!   r6   r	   r   r7   r   r   r   r"   r   r   r   r   r5      s   r5   c                       sT   e Zd ZdZdZdZdZdZdZdd Z	dd Z
dd	 Zd
d Z fddZ  ZS )MemberSpaceLimitTypea  
    The type of the space limit imposed on a team member.

    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 team_common.MemberSpaceLimitType.off: The team member does not have
        imposed space limit.
    :ivar team_common.MemberSpaceLimitType.alert_only: The team member has soft
        imposed space limit - the limit is used for display and for
        notifications.
    :ivar team_common.MemberSpaceLimitType.stop_sync: The team member has hard
        imposed space limit - Dropbox file sync will stop after the limit is
        reached.
    r   Nc                 C   s
   | j dkS )zJ
        Check if the union tag is ``off``.

        :rtype: bool
        offr
   r   r   r   r   is_off   s    zMemberSpaceLimitType.is_offc                 C   s
   | j dkS )zQ
        Check if the union tag is ``alert_only``.

        :rtype: bool
        
alert_onlyr
   r   r   r   r   is_alert_only   s    z"MemberSpaceLimitType.is_alert_onlyc                 C   s
   | j dkS )zP
        Check if the union tag is ``stop_sync``.

        :rtype: bool
        	stop_syncr
   r   r   r   r   is_stop_sync   s    z!MemberSpaceLimitType.is_stop_syncc                 C   s
   | j dkS r   r
   r   r   r   r   r      s    zMemberSpaceLimitType.is_otherc                    s   t t| ||| d S r   )r   r8   r   r   r   r   r   r      s    z0MemberSpaceLimitType._process_custom_annotations)r   r   r   r    r!   r9   r;   r=   r   r:   r<   r>   r   r   r"   r   r   r   r   r8      s   r8   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jdd	d
Z
 fddZ  ZS )	TimeRangez
    Time range.

    :ivar team_common.TimeRange.start_time: Optional starting time (inclusive).
    :ivar team_common.TimeRange.end_time: Optional ending time (exclusive).
    _start_time_value_end_time_valueFNc                 C   s0   t j| _t j| _|d k	r|| _|d k	r,|| _d S r   )r)   r*   r@   rA   
start_timeend_time)r   rB   rC   r   r   r   r0     s    zTimeRange.__init__rB   Tr1   rC   c                    s   t t| ||| d S r   )r   r?   r   r   r   r   r   r     s    z%TimeRange._process_custom_annotations)NN)r   r   r   r    r2   r3   r0   r)   r4   rB   rC   r   r"   r   r   r   r   r?      s     
r?   @   )
max_length)r	   r   r   r   r	   r   r   r   r+   r,   r-   r.   r/   )r6   r	   r   r6   )r9   r;   r=   r   r9   r;   r=   rB   rC   N)=
__future__r   Zstone.backends.python_rsrcr   r)   r   ZbvZdropboxr   Unionr   ZGroupManagementType_validatorStructr#   ZGroupSummary_validatorr5   ZGroupType_validatorr8   ZMemberSpaceLimitType_validatorr?   ZTimeRange_validatorStringZGroupExternalId_validatorZGroupId_validatorZMemberExternalId_validatorZResellerId_validatorZTeamId_validatorZTeamMemberId_validatorZVoidZ_user_managed_validatorZ_company_managed_validatorZ_system_managed_validatorZ_other_validatorZ_tagmapr	   r   r   r   r+   Z	validatorr,   ZNullabler-   ZUInt32r.   r/   setZ_all_field_names_Z_all_fields_Z_team_validatorr6   Z_off_validatorZ_alert_only_validatorZ_stop_sync_validatorr9   r;   r=   ZDropboxTimestamp_validatorrB   rC   ZROUTESr   r   r   r   <module>   s   =
>
2
?
"





























