U
    ^g%i&                     @   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 - Routes
    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dZdeeeef ee d fddZ	e
dddd	Zd dd
dZd dddZejejfeeef eeef d dddZejejfeeef eeef d dddZedddZ  ZS )TrunkInstancea  
    :ivar sip_trunk_domain: The absolute URL of the SIP Trunk
    :ivar url: The absolute URL of the resource.
    :ivar sid: A 34 character string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk.
    :ivar account_sid: The unique SID identifier of the Account.
    :ivar friendly_name: A human readable description of the Inbound Processing Region assignments for this SIP Trunk, up to 64 characters.
    :ivar voice_region: The Inbound Processing Region used for this SIP Trunk for voice.
    :ivar date_created: The date that this SIP Trunk was assigned an Inbound Processing Region, given in ISO 8601 format.
    :ivar date_updated: The date that the Inbound Processing Region was updated for this SIP Trunk, given in ISO 8601 format.
    N)versionpayloadsip_trunk_domainc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _t	
|d| _d|p| ji| _d | _d S )	Nr   urlsidaccount_sidfriendly_namevoice_regiondate_createddate_updated)super__init__getr   r   r   r   r   r   r   Ziso8601_datetimer   r   	_solution_context)selfr   r   r   	__class__ Z/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/routes/v2/trunk.pyr   $   s"     zTrunkInstance.__init__TrunkContext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: TrunkContext for this TrunkInstance
        Nr   r   )r   r"   _versionr   r   r    r    r!   _proxy>   s    
zTrunkInstance._proxyc                 C   s
   | j  S )W
        Fetch the TrunkInstance


        :returns: The fetched TrunkInstance
        )r(   fetchr'   r    r    r!   r*   M   s    zTrunkInstance.fetchc                    s   | j  I dH S )q
        Asynchronous coroutine to fetch the TrunkInstance


        :returns: The fetched TrunkInstance
        N)r(   fetch_asyncr'   r    r    r!   r,   V   s    zTrunkInstance.fetch_asyncr   r   r$   c                 C   s   | j j||dS )  
        Update the TrunkInstance

        :param voice_region: The Inbound Processing Region used for this SIP Trunk for voice
        :param friendly_name: A human readable description of this resource, up to 64 characters.

        :returns: The updated TrunkInstance
        r   r   )r(   updater   r   r   r    r    r!   r0   _   s    zTrunkInstance.updatec                    s   | j j||dI dH S )1  
        Asynchronous coroutine to update the TrunkInstance

        :param voice_region: The Inbound Processing Region used for this SIP Trunk for voice
        :param friendly_name: A human readable description of this resource, up to 64 characters.

        :returns: The updated TrunkInstance
        r/   N)r(   update_asyncr1   r    r    r!   r3   q   s    zTrunkInstance.update_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>   s     z)TrunkInstance.__repr__.<locals>.<genexpr>z#<Twilio.Routes.V2.TrunkInstance {}>joinr   itemsr8   r   contextr    r    r!   __repr__   s    zTrunkInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr(   r*   r,   r   unsetr   objectr0   r3   rC   __classcell__r    r    r   r!   r      s4    
	



r   c                       s   e Zd Zeed fddZedddZedddZe	j
e	j
feeef eeef ed	d
dZe	j
e	j
feeef eeef 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 )z
        Initialize the TrunkContext

        :param version: Version that contains the resource
        :param sip_trunk_domain: The absolute URL of the SIP Trunk
        r   z/Trunks/{sip_trunk_domain}N)r   r   r   r8   _uri)r   r   r   r   r    r!   r      s
     zTrunkContext.__init__r#   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r)   application/jsonAcceptGETmethoduriheadersr   r%   )r   ofr&   r*   rM   r   r   r   rT   r   r    r    r!   r*      s    
zTrunkContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r+   rN   rO   rP   rQ   Nr   r%   )r   rU   r&   r,   rM   r   r   rV   r    r    r!   r,      s    
  zTrunkContext.fetch_asyncr-   c                 C   sV   t ||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r.   ZVoiceRegionZFriendlyName!application/x-www-form-urlencodedContent-TyperN   rO   POSTrR   rS   datarT   r   r%   )r   rU   r&   r0   rM   r   r   r   r   r   r\   rT   r   r    r    r!   r0      s&    
     zTrunkContext.updatec                    s\   t ||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r2   rW   rX   rY   rN   rO   rZ   r[   Nr   r%   )r   rU   r&   r3   rM   r   r   r]   r    r    r!   r3      s&    
     zTrunkContext.update_asyncc                 C   s$   d dd | j D }d|S )r4   r5   c                 s   s   | ]\}}d  ||V  qdS r6   r7   r9   r    r    r!   r=     s     z(TrunkContext.__repr__.<locals>.<genexpr>z"<Twilio.Routes.V2.TrunkContext {}>r>   rA   r    r    r!   rC     s    zTrunkContext.__repr__)rD   rE   rF   r   rH   r   r   r*   r,   r   rJ   r   rK   r0   r3   rC   rL   r    r    r   r!   r"      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d	d
dZ	  Z
S )	TrunkList)r   c                    s   t  | dS )zg
        Initialize the TrunkList

        :param version: Version that contains the resource

        N)r   r   )r   r   r   r    r!   r     s    zTrunkList.__init__)r   r$   c                 C   s   t | j|dS zo
        Constructs a TrunkContext

        :param sip_trunk_domain: The absolute URL of the SIP Trunk
        r%   r"   r&   r   r   r    r    r!   r   !  s    zTrunkList.getc                 C   s   t | j|dS r_   r`   ra   r    r    r!   __call__)  s    zTrunkList.__call__r#   c                 C   s   dS )r4   z<Twilio.Routes.V2.TrunkList>r    r'   r    r    r!   rC   1  s    zTrunkList.__repr__)rD   rE   rF   r   r   rH   r"   r   rb   rC   rL   r    r    r   r!   r^     s   	r^   N)rG   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"   r^   r    r    r    r!   <module>   s   u 
