U
    k7g                     @   sp   d Z ddlmZmZmZmZ 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	ZG d	d
 d
eZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Oauth
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )AnyDictOptionalUnion)values)InstanceResource)ListResource)Versionc                       s>   e Zd ZdZeeeef d fddZedddZ	  Z
S )TokenInstancea]  
    :ivar access_token: Token which carries the necessary information to access a Twilio resource directly.
    :ivar refresh_token: Token which carries the information necessary to get a new access token.
    :ivar id_token: Token which carries the information necessary of user profile.
    :ivar token_type: Token type
    :ivar expires_in:
    )versionpayloadc                    sL   t  | |d| _|d| _|d| _|d| _|d| _d S )Naccess_tokenrefresh_tokenid_token
token_type
expires_in)super__init__getr   r   r   r   r   )selfr   r   	__class__ >/tmp/pip-unpacked-wheel-qtbjxrb6/twilio/rest/oauth/v1/token.pyr       s    zTokenInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z<Twilio.Oauth.V1.TokenInstance>r   r   r   r   r   __repr__)   s    zTokenInstance.__repr__)__name__
__module____qualname____doc__r	   r   strr   r   r   __classcell__r   r   r   r   r
      s   	r
   c                       s   e Zd Zed fddZejejejejejejfeeeee	f eee	f eee	f eee	f eee	f eee	f e
d	ddZejejejejejejfeeeee	f eee	f eee	f eee	f eee	f eee	f e
d	ddZed	d
dZ  ZS )	TokenList)r   c                    s   t  | d| _dS )zg
        Initialize the TokenList

        :param version: Version that contains the resource

        z/tokenN)r   r   _uri)r   r   r   r   r   r   5   s    zTokenList.__init__)	
grant_type	client_idclient_secretcoderedirect_uriaudiencer   scoper   c	                 C   sL   t ||||||||d}	t ddi}
| jjd| j|	|
d}t| j|S )a  
        Create the TokenInstance

        :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.
        :param client_id: A 34 character string that uniquely identifies this OAuth App.
        :param client_secret: The credential for confidential OAuth App.
        :param code: JWT token related to the authorization code grant type.
        :param redirect_uri: The redirect uri
        :param audience: The targeted audience uri
        :param refresh_token: JWT token related to refresh access token.
        :param scope: The scope of token

        :returns: The created TokenInstance
        Z	GrantTypeZClientIdZClientSecretZCodeZRedirectUriZAudienceZRefreshTokenZScopeContent-Type!application/x-www-form-urlencodedPOSTmethoduridataheaders)r   of_versioncreater&   r
   r   r'   r(   r)   r*   r+   r,   r   r-   r5   r6   r   r   r   r   r9   @   s&       zTokenList.createc	                    sR   t ||||||||d}	t ddi}
| jjd| j|	|
dI dH }t| j|S )a  
        Asynchronously create the TokenInstance

        :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.
        :param client_id: A 34 character string that uniquely identifies this OAuth App.
        :param client_secret: The credential for confidential OAuth App.
        :param code: JWT token related to the authorization code grant type.
        :param redirect_uri: The redirect uri
        :param audience: The targeted audience uri
        :param refresh_token: JWT token related to refresh access token.
        :param scope: The scope of token

        :returns: The created TokenInstance
        r.   r/   r0   r1   r2   N)r   r7   r8   create_asyncr&   r
   r:   r   r   r   r;   n   s&       zTokenList.create_asyncr   c                 C   s   dS )r   z<Twilio.Oauth.V1.TokenList>r   r   r   r   r   r      s    zTokenList.__repr__)r   r    r!   r	   r   r   Zunsetr#   r   objectr
   r9   r;   r   r$   r   r   r   r   r%   3   sH   





2





.r%   N)r"   typingr   r   r   r   Ztwilio.baser   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr	   r
   r%   r   r   r   r   <module>   s   