U
    Zf                      @   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e e_e e_ejejde_ede_e	ej_edge_dejjfg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de_ede_!ede_"ede_#ede_$ede_%ede_e ej&_edge_dej&jfge_e'dddeeeddddZ(de(iZ)dS )    )unicode_literals)
stone_base)stone_validatorsc                       sL   e Zd ZdZdZdZedd Zdd Zdd	 Z	d
d Z
 fddZ  ZS )PhotoSourceArga$  
    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 str account.PhotoSourceArg.base64_data: Image data in base64-encoded
        bytes.
    otherNc                 C   s
   | d|S )z
        Create an instance of this class set to the ``base64_data`` tag with
        value ``val``.

        :param str val:
        :rtype: PhotoSourceArg
        base64_data )clsvalr   r   3/tmp/pip-unpacked-wheel-qnjxxdf1/dropbox/account.pyr      s    	zPhotoSourceArg.base64_datac                 C   s
   | j dkS )zR
        Check if the union tag is ``base64_data``.

        :rtype: bool
        r   Z_tagselfr   r   r   is_base64_data#   s    zPhotoSourceArg.is_base64_datac                 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PhotoSourceArg.is_otherc                 C   s   |   std| jS )z
        Image data in base64-encoded bytes.

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

        :rtype: str
        ztag 'base64_data' not set)r   AttributeError_valuer   r   r   r   get_base64_data3   s    zPhotoSourceArg.get_base64_datac                    s   t t| ||| d S N)superr   _process_custom_annotationsr   Zannotation_typeZ
field_path	processor	__class__r   r   r   ?   s    z*PhotoSourceArg._process_custom_annotations)__name__
__module____qualname____doc__
_catch_allr   classmethodr   r   r   r   r   __classcell__r   r   r   r   r   
   s   	

r   c                       sB   e Zd ZdZdgZdZdddZejdddZ	 fd	d
Z
  ZS )SetProfilePhotoArgzg
    :ivar account.SetProfilePhotoArg.photo: Image to set as the user's new
        profile photo.
    _photo_valueTNc                 C   s   t j| _|d k	r|| _d S r   )bbNOT_SETr$   photo)r   r'   r   r   r   __init__P   s    zSetProfilePhotoArg.__init__r'   )Zuser_definedc                    s   t t| ||| d S r   )r   r#   r   r   r   r   r   r   Y   s    z.SetProfilePhotoArg._process_custom_annotations)N)r   r   r   r   	__slots___has_required_fieldsr(   r%   	Attributer'   r   r"   r   r   r   r   r#   D   s    
r#   c                       sl   e Zd Zd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dd Zdd Z fddZ  ZS )SetProfilePhotoErrora  
    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 account.SetProfilePhotoError.file_type_error: File cannot be set as
        profile photo.
    :ivar account.SetProfilePhotoError.file_size_error: File cannot exceed 10
        MB.
    :ivar account.SetProfilePhotoError.dimension_error: Image must be larger
        than 128 x 128.
    :ivar account.SetProfilePhotoError.thumbnail_error: Image could not be
        thumbnailed.
    :ivar account.SetProfilePhotoError.transient_error: Temporary infrastructure
        failure, please retry.
    r   Nc                 C   s
   | j dkS )zV
        Check if the union tag is ``file_type_error``.

        :rtype: bool
        file_type_errorr   r   r   r   r   is_file_type_error~   s    z'SetProfilePhotoError.is_file_type_errorc                 C   s
   | j dkS )zV
        Check if the union tag is ``file_size_error``.

        :rtype: bool
        file_size_errorr   r   r   r   r   is_file_size_error   s    z'SetProfilePhotoError.is_file_size_errorc                 C   s
   | j dkS )zV
        Check if the union tag is ``dimension_error``.

        :rtype: bool
        dimension_errorr   r   r   r   r   is_dimension_error   s    z'SetProfilePhotoError.is_dimension_errorc                 C   s
   | j dkS )zV
        Check if the union tag is ``thumbnail_error``.

        :rtype: bool
        thumbnail_errorr   r   r   r   r   is_thumbnail_error   s    z'SetProfilePhotoError.is_thumbnail_errorc                 C   s
   | j dkS )zV
        Check if the union tag is ``transient_error``.

        :rtype: bool
        transient_errorr   r   r   r   r   is_transient_error   s    z'SetProfilePhotoError.is_transient_errorc                 C   s
   | j dkS r   r   r   r   r   r   r      s    zSetProfilePhotoError.is_otherc                    s   t t| ||| d S r   )r   r,   r   r   r   r   r   r      s    z0SetProfilePhotoError._process_custom_annotations)r   r   r   r   r    r-   r/   r1   r3   r5   r   r.   r0   r2   r4   r6   r   r   r"   r   r   r   r   r,   ^   s   r,   c                       s>   e Zd ZdZdgZdZd
ddZedZ	 fdd	Z
  ZS )SetProfilePhotoResultz
    :ivar account.SetProfilePhotoResult.profile_photo_url: URL for the photo
        representing the user, if one is set.
    _profile_photo_url_valueTNc                 C   s   t j| _|d k	r|| _d S r   )r%   r&   r8   profile_photo_url)r   r9   r   r   r   r(      s    zSetProfilePhotoResult.__init__r9   c                    s   t t| ||| d S r   )r   r7   r   r   r   r   r   r      s    z1SetProfilePhotoResult._process_custom_annotations)N)r   r   r   r   r)   r*   r(   r%   r+   r9   r   r"   r   r   r   r   r7      s    

r7   )r   r   r   r'   )r-   r/   r1   r3   r5   r   r-   r/   r1   r3   r5   r9   set_profile_photo   FuserapiZrpc)authhoststyleN)*
__future__r   Zstone.backends.python_rsrcr   r%   r   ZbvUnionr   ZPhotoSourceArg_validatorStructr#   ZSetProfilePhotoArg_validatorr,   ZSetProfilePhotoError_validatorr7   ZSetProfilePhotoResult_validatorStringZ_base64_data_validatorZVoidZ_other_validatorZ_tagmapr   r'   Z	validatorsetZ_all_field_names_Z_all_fields_Z_file_type_error_validatorZ_file_size_error_validatorZ_dimension_error_validatorZ_thumbnail_error_validatorZ_transient_error_validatorr-   r/   r1   r3   r5   r9   ZRouter:   ZROUTESr   r   r   r   <module>   sp   8

S










	





 