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de_eg e_g e_e	e_e e_ejejde_ede_ee ej_ee ej_ee ej _ee! ej"_e ej#_e ej$_ed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dej$jfge_dej#_%dej$_%e&dddeeeddddZ'de'iZ(dS )    )unicode_literals)
stone_base)stone_validatorsc                       s<   e Zd ZdZdZdZdZdd Zdd Z fdd	Z	  Z
S )
OpenIdErrora;  
    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 openid.OpenIdError.incorrect_openid_scopes: Missing openid claims for
        the associated access token.
    otherNc                 C   s
   | j dkS )z^
        Check if the union tag is ``incorrect_openid_scopes``.

        :rtype: bool
        incorrect_openid_scopesZ_tagself r   2/tmp/pip-unpacked-wheel-qnjxxdf1/dropbox/openid.pyis_incorrect_openid_scopes   s    z&OpenIdError.is_incorrect_openid_scopesc                 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OpenIdError.is_otherc                    s   t t| ||| d S N)superr   _process_custom_annotationsr
   Zannotation_typeZ
field_path	processor	__class__r   r   r   *   s    z'OpenIdError._process_custom_annotations)__name__
__module____qualname____doc__
_catch_allr   r   r   r   r   __classcell__r   r   r   r   r   
   s   	r   c                       s0   e Zd ZdZg ZdZdd Z fddZ  ZS )UserInfoArgsz
    No Parameters
    Fc                 C   s   d S r   r   r	   r   r   r   __init__9   s    zUserInfoArgs.__init__c                    s   t t| ||| d S r   )r   r   r   r   r   r   r   r   <   s    z(UserInfoArgs._process_custom_annotations)	r   r   r   r   	__slots___has_required_fieldsr   r   r   r   r   r   r   r   /   s
   r   c                       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 )UserInfoErrorz
    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.
    r   Nc                 C   s
   | d|S )z
        Create an instance of this class set to the ``openid_error`` tag with
        value ``val``.

        :param OpenIdError val:
        :rtype: UserInfoError
        openid_errorr   )clsvalr   r   r   r"   L   s    	zUserInfoError.openid_errorc                 C   s
   | j dkS )zS
        Check if the union tag is ``openid_error``.

        :rtype: bool
        r"   r   r	   r   r   r   is_openid_errorW   s    zUserInfoError.is_openid_errorc                 C   s
   | j dkS r   r   r	   r   r   r   r   _   s    zUserInfoError.is_otherc                 C   s   |   std| jS )za
        Only call this if :meth:`is_openid_error` is true.

        :rtype: OpenIdError
        ztag 'openid_error' not set)r%   AttributeError_valuer	   r   r   r   get_openid_errorg   s    zUserInfoError.get_openid_errorc                    s   t t| ||| d S r   )r   r!   r   r   r   r   r   r   q   s    z)UserInfoError._process_custom_annotations)r   r   r   r   r   r   classmethodr"   r%   r   r(   r   r   r   r   r   r   r!   A   s   


r!   c                       s   e Zd ZdZddddddgZdZdd
dZejdddZ	ejdddZ
ejdddZejdddZedZedZ fddZ  ZS )UserInfoResulta  
    :ivar openid.UserInfoResult.family_name: Last name of user.
    :ivar openid.UserInfoResult.given_name: First name of user.
    :ivar openid.UserInfoResult.email: Email address of user.
    :ivar openid.UserInfoResult.email_verified: If user is email verified.
    :ivar openid.UserInfoResult.iss: Issuer of token (in this case Dropbox).
    :ivar openid.UserInfoResult.sub: An identifier for the user. This is the
        Dropbox account_id, a string value such as
        dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc.
    _family_name_value_given_name_value_email_value_email_verified_value
_iss_value
_sub_valueFNc                 C   s   t j| _t j| _t j| _t j| _t j| _t j| _|d k	r>|| _|d k	rL|| _	|d k	rZ|| _
|d k	rh|| _|d k	rv|| _|d k	r|| _d S r   )bbZNOT_SETr+   r,   r-   r.   r/   r0   family_name
given_nameemailemail_verifiedisssub)r
   r2   r3   r4   r5   r6   r7   r   r   r   r      s$    zUserInfoResult.__init__r2   T)Znullabler3   r4   r5   r6   r7   c                    s   t t| ||| d S r   )r   r*   r   r   r   r   r   r      s    z*UserInfoResult._process_custom_annotations)NNNNNN)r   r   r   r   r   r    r   r1   	Attributer2   r3   r4   r5   r6   r7   r   r   r   r   r   r   r*   v   s.   	      


r*   )r   r   r   r   )r"   r   r2   r3   r4   r5   r6   r7    userinfo   FuserapiZrpc)authhoststyleN))
__future__r   Zstone.backends.python_rsrcr   r1   r   ZbvUnionr   ZOpenIdError_validatorStructr   ZUserInfoArgs_validatorr!   ZUserInfoError_validatorr*   ZUserInfoResult_validatorZVoidZ"_incorrect_openid_scopes_validatorZ_other_validatorZ_tagmapr   r   setZ_all_field_names_Z_all_fields_Z_openid_error_validatorZNullableStringr2   Z	validatorr3   r4   Booleanr5   r6   r7   defaultZRouter:   ZROUTESr   r   r   r   <module>   s~   #

3
F







	





	 