U
    ^g%i7*                     @   s   d Z ddlmZ ddlmZmZmZmZ ddl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G dd deZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Verify
    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.
    )datetime)AnyDictOptionalUnion)deserializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZG dd deZdeeeef ee	e d fddZ
eddd	d
Zd dddZd dddZedddZ  ZS )AccessTokenInstancec                   @   s   e Zd ZdZdS )AccessTokenInstance.FactorTypespushN)__name__
__module____qualname__ZPUSH r   r   i/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/verify/v2/service/access_token.pyFactorTypes   s   r   N)versionpayloadservice_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
t|d	| _t|d
| _||p| jd| _d | _d S )Nr   account_sidr   entity_identityfactor_typefactor_friendly_nametokenurlttldate_createdr   r   )super__init__getr   r   r   r   r   r   r   r   r   integerr    Ziso8601_datetimer!   	_solution_context)selfr   r   r   r   	__class__r   r   r$   *   s&    zAccessTokenInstance.__init__AccessTokenContextreturnc                 C   s.   | j dkr(t| j| jd | jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: AccessTokenContext for this AccessTokenInstance
        Nr   r   r"   )r(   r,   _versionr'   r)   r   r   r   _proxyH   s    
zAccessTokenInstance._proxyc                 C   s
   | j  S )c
        Fetch the AccessTokenInstance


        :returns: The fetched AccessTokenInstance
        )r1   fetchr0   r   r   r   r3   X   s    zAccessTokenInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the AccessTokenInstance


        :returns: The fetched AccessTokenInstance
        N)r1   fetch_asyncr0   r   r   r   r5   a   s    zAccessTokenInstance.fetch_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>p   s     z/AccessTokenInstance.__repr__.<locals>.<genexpr>z)<Twilio.Verify.V2.AccessTokenInstance {}>joinr'   itemsr:   r)   contextr   r   r   __repr__j   s    zAccessTokenInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r$   propertyr1   r3   r5   rE   __classcell__r   r   r*   r   r      s    
		r   c                       sP   e Zd Zeeed fddZedddZedddZedd	d
Z	  Z
S )r,   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the AccessTokenContext

        :param version: Version that contains the resource
        :param service_sid: The unique SID identifier of the Service.
        :param sid: A 34 character string that uniquely identifies this Access Token.
        r"   z*/Services/{service_sid}/AccessTokens/{sid}Nr#   r$   r'   r:   _uri)r)   r   r   r   r*   r   r   r$   v   s    zAccessTokenContext.__init__r-   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r2   application/jsonAcceptGETmethoduriheadersr   r   r"   )r   ofr/   r3   rK   r   r'   r)   rR   r   r   r   r   r3      s    
zAccessTokenContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r4   rL   rM   rN   rO   Nr   r   r"   )r   rS   r/   r5   rK   r   r'   rT   r   r   r   r5      s    
  zAccessTokenContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r6   r7   c                 s   s   | ]\}}d  ||V  qdS r8   r9   r;   r   r   r   r?      s     z.AccessTokenContext.__repr__.<locals>.<genexpr>z(<Twilio.Verify.V2.AccessTokenContext {}>r@   rC   r   r   r   rE      s    zAccessTokenContext.__repr__)r   r   r   r   rG   r$   r   r3   r5   rE   rI   r   r   r*   r   r,   t   s   r,   c                       s   e Zd Zeed fddZejejfedeee	f ee
e	f edddZejejfedeee	f ee
e	f eddd	Zeed
ddZeed
ddZedddZ  ZS )AccessTokenList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the AccessTokenList

        :param version: Version that contains the resource
        :param service_sid: The unique SID identifier of the Service.

        r   z$/Services/{service_sid}/AccessTokensNrJ   )r)   r   r   r*   r   r   r$      s
     zAccessTokenList.__init__r   )identityr   r   r    r.   c                 C   s^   t ||||d}t ddi}d|d< d|d< | jjd| j||d}t| j|| jd d	S )
aF  
        Create the AccessTokenInstance

        :param identity: The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID.
        :param factor_type:
        :param factor_friendly_name: The friendly name of the factor that is going to be created with this access token
        :param ttl: How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60.

        :returns: The created AccessTokenInstance
        ZIdentityZ
FactorTypeZFactorFriendlyNameZTtlContent-Type!application/x-www-form-urlencodedrL   rM   POSTrP   rQ   datarR   r   r   )r   rS   r/   createrK   r   r'   r)   rV   r   r   r    r\   rR   r   r   r   r   r^      s*         zAccessTokenList.createc                    sd   t ||||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )aU  
        Asynchronously create the AccessTokenInstance

        :param identity: The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID.
        :param factor_type:
        :param factor_friendly_name: The friendly name of the factor that is going to be created with this access token
        :param ttl: How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60.

        :returns: The created AccessTokenInstance
        rW   rX   rY   rL   rM   rZ   r[   Nr   r]   )r   rS   r/   create_asyncrK   r   r'   r_   r   r   r   r`      s*         zAccessTokenList.create_async)r   r.   c                 C   s   t | j| jd |dS z
        Constructs a AccessTokenContext

        :param sid: A 34 character string that uniquely identifies this Access Token.
        r   r"   r,   r/   r'   r)   r   r   r   r   r%   !  s
      zAccessTokenList.getc                 C   s   t | j| jd |dS ra   rb   rc   r   r   r   __call__+  s
      zAccessTokenList.__call__r-   c                 C   s   dS )r6   z"<Twilio.Verify.V2.AccessTokenList>r   r0   r   r   r   rE   5  s    zAccessTokenList.__repr__)r   r   r   r   rG   r$   r   unsetr   rF   intr   r^   r`   r,   r%   rd   rE   rI   r   r   r*   r   rU      s,   

,

(

rU   N)__doc__r   typingr   r   r   r   Ztwilio.baser   r   Ztwilio.base.instance_contextr	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r,   rU   r   r   r   r   <module>   s   \K