U
    ^g%i!                     @   s   d Z ddl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 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.
    )AnyDictOptional)values)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZdZdeeeef ee d fddZ	e
dddd	Zedd
dZedddZd dddZd dddZedddZ  ZS )SafelistInstancez
    :ivar sid: The unique string that we created to identify the SafeList resource.
    :ivar phone_number: The phone number in SafeList.
    :ivar url: The absolute URL of the SafeList resource.
    N)versionpayloadphone_numberc                    sJ   t  | |d| _|d| _|d| _d|p:| ji| _d | _d S )Nsidr   url)super__init__getr   r   r   	_solution_context)selfr   r   r   	__class__ ]/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/verify/v2/safelist.pyr      s     zSafelistInstance.__init__SafelistContextreturnc                 C   s&   | j dkr t| j| 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: SafelistContext for this SafelistInstance
        Nr   r   )r   r   _versionr   r   r   r   r   _proxy/   s    
zSafelistInstance._proxyc                 C   s
   | j  S )k
        Deletes the SafelistInstance


        :returns: True if delete succeeds, False otherwise
        )r    deleter   r   r   r   r"   >   s    zSafelistInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the SafelistInstance


        :returns: True if delete succeeds, False otherwise
        N)r    delete_asyncr   r   r   r   r$   G   s    zSafelistInstance.delete_asyncc                 C   s
   | j  S )]
        Fetch the SafelistInstance


        :returns: The fetched SafelistInstance
        )r    fetchr   r   r   r   r&   P   s    zSafelistInstance.fetchc                    s   | j  I dH S )w
        Asynchronous coroutine to fetch the SafelistInstance


        :returns: The fetched SafelistInstance
        N)r    fetch_asyncr   r   r   r   r(   Y   s    zSafelistInstance.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>h   s     z,SafelistInstance.__repr__.<locals>.<genexpr>z&<Twilio.Verify.V2.SafelistInstance {}>joinr   itemsr-   r   contextr   r   r   __repr__b   s    zSafelistInstance.__repr__)N)__name__
__module____qualname____doc__r	   r   strr   r   r   propertyr    boolr"   r$   r&   r(   r8   __classcell__r   r   r   r   r
      s   
 
				r
   c                       sj   e Zd Zeed fddZedddZedddZe	dd	d
Z
e	dddZedddZ  ZS )r   )r   r   c                    s*   t  | d|i| _djf | j| _dS )a  
        Initialize the SafelistContext

        :param version: Version that contains the resource
        :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
        r   z /SafeList/Numbers/{phone_number}N)r   r   r   r-   _uri)r   r   r   r   r   r   r   n   s
     zSafelistContext.__init__r   c                 C   s   t i }| jjd| j|dS )r!   DELETEmethoduriheaders)r   ofr   r"   rA   r   rF   r   r   r   r"   }   s    
zSafelistContext.deletec                    s$   t i }| jjd| j|dI dH S )r#   rB   rC   N)r   rG   r   r$   rA   rH   r   r   r   r$      s    
  zSafelistContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r%   application/jsonAcceptGETrC   r   r   )r   rG   r   r&   rA   r
   r   r   rF   r   r   r   r   r&      s    
zSafelistContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r'   rI   rJ   rK   rC   Nr   r   )r   rG   r   r(   rA   r
   r   rL   r   r   r   r(      s    
  zSafelistContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r)   r*   c                 s   s   | ]\}}d  ||V  qdS r+   r,   r.   r   r   r   r2      s     z+SafelistContext.__repr__.<locals>.<genexpr>z%<Twilio.Verify.V2.SafelistContext {}>r3   r6   r   r   r   r8      s    zSafelistContext.__repr__)r9   r:   r;   r	   r=   r   r?   r"   r$   r
   r&   r(   r8   r@   r   r   r   r   r   l   s   r   c                       sp   e Zd Zed fddZeedddZeedddZee	dd	d
Z
ee	dddZedddZ  ZS )SafelistList)r   c                    s   t  | d| _dS )zj
        Initialize the SafelistList

        :param version: Version that contains the resource

        z/SafeList/NumbersN)r   r   rA   )r   r   r   r   r   r      s    zSafelistList.__init__)r   r   c                 C   sN   t d|i}t ddi}d|d< d|d< | jjd| j||d}t| j|S )z
        Create the SafelistInstance

        :param phone_number: The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).

        :returns: The created SafelistInstance
        PhoneNumberContent-Type!application/x-www-form-urlencodedrI   rJ   POSTrD   rE   datarF   )r   rG   r   createrA   r
   r   r   rS   rF   r   r   r   r   rT      s    	    zSafelistList.createc                    sT   t d|i}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously create the SafelistInstance

        :param phone_number: The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).

        :returns: The created SafelistInstance
        rN   rO   rP   rI   rJ   rQ   rR   N)r   rG   r   create_asyncrA   r
   rU   r   r   r   rV      s    	    zSafelistList.create_asyncc                 C   s   t | j|dS z
        Constructs a SafelistContext

        :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
        r   r   r   r   r   r   r   r   r     s    zSafelistList.getc                 C   s   t | j|dS rW   rX   rY   r   r   r   __call__  s    zSafelistList.__call__r   c                 C   s   dS )r)   z<Twilio.Verify.V2.SafelistList>r   r   r   r   r   r8     s    zSafelistList.__repr__)r9   r:   r;   r	   r   r=   r
   rT   rV   r   r   rZ   r8   r@   r   r   r   r   rM      s   rM   N)r<   typingr   r   r   Ztwilio.baser   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr	   r
   r   rM   r   r   r   r   <module>   s   U_