o
    eP                     @   s   d 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	 ddl
mZ G dd	 d	e	ZG d
d deZG dd deZG dd deZdS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                
       s   e Zd Z fddZejejejejejejejejejejf
ddZdddZddd	Zejejejfd
dZ	dd Z
dd Zdd Zdd Z  ZS )ByocTrunkListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the ByocTrunkList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.voice.v1.byoc_trunk.ByocTrunkList
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkList
        z/ByocTrunksN )superr   __init__	_solutionformat_uri)selfversion	__class__r	   R/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/voice/v1/byoc_trunk.pyr      s   	zByocTrunkList.__init__c                 C   s@   t |||||||||	|
d
}| jjd| j|d}t| j|S )aZ  
        Create the ByocTrunkInstance

        :param unicode friendly_name: A string to describe the resource
        :param unicode voice_url: The URL we should call when receiving a call
        :param unicode voice_method: The HTTP method to use with voice_url
        :param unicode voice_fallback_url: The URL we should call when an error occurs in executing TwiML
        :param unicode voice_fallback_method: The HTTP method to use with voice_fallback_url
        :param unicode status_callback_url: The URL that we should call to pass status updates
        :param unicode status_callback_method: The HTTP method we should use to call `status_callback_url`
        :param bool cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk
        :param unicode connection_policy_sid: Origination Connection Policy (to your Carrier)
        :param unicode from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls

        :returns: The created ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        
FriendlyNameVoiceUrlVoiceMethodVoiceFallbackUrlVoiceFallbackMethodStatusCallbackUrlStatusCallbackMethodCnamLookupEnabledConnectionPolicySidFromDomainSidPOSTmethoduridata)r   of_versioncreater   ByocTrunkInstancer   friendly_name	voice_urlvoice_methodvoice_fallback_urlvoice_fallback_methodstatus_callback_urlstatus_callback_methodcnam_lookup_enabledconnection_policy_sidfrom_domain_sidr#   payloadr	   r	   r   r&   "   s   zByocTrunkList.createNc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams ByocTrunkInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, stream() will attempt to read the
                              limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance]
        	page_size)r4   limit)r%   read_limitspagestream)r   r5   r4   limitsr7   r	   r	   r   r8   J   s   zByocTrunkList.streamc                 C   s   t | j||dS )a_  
        Lists ByocTrunkInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, list() will attempt to read the limit
                              with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance]
        )r5   r4   )listr8   )r   r5   r4   r	   r	   r   r:   a   s   zByocTrunkList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of ByocTrunkInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkPage
        )	PageTokenr   PageSizeGET)r!   r"   params)r   r$   r%   r7   r   ByocTrunkPager   )r   
page_tokenpage_numberr4   r#   responser	   r	   r   r7   s   s   zByocTrunkList.pagec                 C   s"   | j jjd|}t| j || jS )a9  
        Retrieve a specific page of ByocTrunkInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkPage
        r=   )r%   domaintwiliorequestr?   r   )r   
target_urlrB   r	   r	   r   get_page   s
   

zByocTrunkList.get_pagec                 C      t | j|dS z
        Constructs a ByocTrunkContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.voice.v1.byoc_trunk.ByocTrunkContext
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkContext
        sidByocTrunkContextr%   r   rK   r	   r	   r   get      	zByocTrunkList.getc                 C   rH   rI   rL   rN   r	   r	   r   __call__   rP   zByocTrunkList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Voice.V1.ByocTrunkList>r	   r   r	   r	   r   __repr__      zByocTrunkList.__repr__)NN)__name__
__module____qualname__r   r   unsetr&   r8   r:   r7   rG   rO   rQ   rU   __classcell__r	   r	   r   r   r      s$    

(

r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )r?   c                    s   t t| || || _dS )a)  
        Initialize the ByocTrunkPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.voice.v1.byoc_trunk.ByocTrunkPage
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkPage
        N)r
   r?   r   r   )r   r   rB   solutionr   r	   r   r      s   

zByocTrunkPage.__init__c                 C   s   t | j|S )z
        Build an instance of ByocTrunkInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        )r'   r%   r   r3   r	   r	   r   get_instance   s   	zByocTrunkPage.get_instancec                 C   rR   )rS   z<Twilio.Voice.V1.ByocTrunkPage>r	   rT   r	   r	   r   rU      rV   zByocTrunkPage.__repr__)rW   rX   rY   r   r^   rU   r[   r	   r	   r   r   r?      s    r?   c                
       sf   e Zd Z fddZdd Zejejejejejejejejejejf
ddZdd Zd	d
 Z	  Z
S )rM   c                    s2   t t| | d|i| _djdi | j| _dS )a=  
        Initialize the ByocTrunkContext

        :param Version version: Version that contains the resource
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.voice.v1.byoc_trunk.ByocTrunkContext
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkContext
        rK   z/ByocTrunks/{sid}Nr	   )r
   rM   r   r   r   r   )r   r   rK   r   r	   r   r      s   

zByocTrunkContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the ByocTrunkInstance

        :returns: The fetched ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        r=   r!   r"   rK   rJ   )r%   fetchr   r'   r   r]   r	   r	   r   ra      s   zByocTrunkContext.fetchc                 C   sJ   t |||||||||	|
d
}| jjd| j|d}t| j|| jd dS )]  
        Update the ByocTrunkInstance

        :param unicode friendly_name: A string to describe the resource
        :param unicode voice_url: The URL we should call when receiving a call
        :param unicode voice_method: The HTTP method we should use with voice_url
        :param unicode voice_fallback_url: The URL we should call when an error occurs in executing TwiML
        :param unicode voice_fallback_method: The HTTP method used with voice_fallback_url
        :param unicode status_callback_url: The URL that we should call to pass status updates
        :param unicode status_callback_method: The HTTP method we should use to call status_callback_url
        :param bool cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk
        :param unicode connection_policy_sid: Origination Connection Policy (to your Carrier)
        :param unicode from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls

        :returns: The updated ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        r   r   r    rK   rJ   )r   r$   r%   updater   r'   r   r(   r	   r	   r   rc      s   zByocTrunkContext.updatec                 C   s   | j jd| jdS )
        Deletes the ByocTrunkInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr`   )r%   deleter   rT   r	   r	   r   rf   "  s   zByocTrunkContext.deletec                 C   $   d dd | j D }d|S )rS    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr	   r	   r   	<genexpr>2      z,ByocTrunkContext.__repr__.<locals>.<genexpr>z%<Twilio.Voice.V1.ByocTrunkContext {}>joinr   itemsr   r   contextr	   r	   r   rU   +     
zByocTrunkContext.__repr__)rW   rX   rY   r   ra   r   rZ   rc   rf   rU   r[   r	   r	   r   r   rM      s    
(	rM   c                
       s(  e Zd Zd, fdd	Zedd Zedd Zedd	 Zed
d Zedd Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zed d! Zed"d# Zd$d% Zejejejejejejejejejejf
d&d'Zd(d) Zd*d+ Z  ZS )-r'   Nc                    s   t t| | |d|d|d|d|d|d|d|d|d	|d
|d|dt|dt|d|dd| _d| _d|pX| jd i| _dS )z
        Initialize the ByocTrunkInstance

        :returns: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkInstance
        account_sidrK   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   date_createddate_updatedurl)rx   rK   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   ry   rz   r{   N)	r
   r'   r   rO   r   iso8601_datetime_properties_contextr   )r   r   r3   rK   r   r	   r   r   8  s&   zByocTrunkInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a/  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: ByocTrunkContext for this ByocTrunkInstance
        :rtype: twilio.rest.voice.v1.byoc_trunk.ByocTrunkContext
        NrK   rJ   )r~   rM   r%   r   rT   r	   r	   r   _proxyX  s   
	zByocTrunkInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rx   r}   rT   r	   r	   r   rx   e     
zByocTrunkInstance.account_sidc                 C   r   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rK   r   rT   r	   r	   r   rK   m  r   zByocTrunkInstance.sidc                 C   r   )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        r)   r   rT   r	   r	   r   r)   u  r   zByocTrunkInstance.friendly_namec                 C   r   )zY
        :returns: The URL we call when receiving a call
        :rtype: unicode
        r*   r   rT   r	   r	   r   r*   }  r   zByocTrunkInstance.voice_urlc                 C   r   )zY
        :returns: The HTTP method to use with voice_url
        :rtype: unicode
        r+   r   rT   r	   r	   r   r+     r   zByocTrunkInstance.voice_methodc                 C   r   )zn
        :returns: The URL we call when an error occurs while executing TwiML
        :rtype: unicode
        r,   r   rT   r	   r	   r   r,     r   z$ByocTrunkInstance.voice_fallback_urlc                 C   r   )z`
        :returns: The HTTP method used with voice_fallback_url
        :rtype: unicode
        r-   r   rT   r	   r	   r   r-     r   z'ByocTrunkInstance.voice_fallback_methodc                 C   r   )z\
        :returns: The URL that we call with status updates
        :rtype: unicode
        r.   r   rT   r	   r	   r   r.     r   z%ByocTrunkInstance.status_callback_urlc                 C   r   )zf
        :returns: The HTTP method we use to call status_callback_url
        :rtype: unicode
        r/   r   rT   r	   r	   r   r/     r   z(ByocTrunkInstance.status_callback_methodc                 C   r   )zn
        :returns: Whether Caller ID Name (CNAM) lookup is enabled for the trunk
        :rtype: bool
        r0   r   rT   r	   r	   r   r0     r   z%ByocTrunkInstance.cnam_lookup_enabledc                 C   r   )zc
        :returns: Origination Connection Policy (to your Carrier)
        :rtype: unicode
        r1   r   rT   r	   r	   r   r1     r   z'ByocTrunkInstance.connection_policy_sidc                 C   r   )z
        :returns: The SID of the SIP Domain that should be used in the `From` header of originating calls
        :rtype: unicode
        r2   r   rT   r	   r	   r   r2     r   z!ByocTrunkInstance.from_domain_sidc                 C   r   )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        ry   r   rT   r	   r	   r   ry     r   zByocTrunkInstance.date_createdc                 C   r   )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rz   r   rT   r	   r	   r   rz     r   zByocTrunkInstance.date_updatedc                 C   r   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r{   r   rT   r	   r	   r   r{     r   zByocTrunkInstance.urlc                 C   
   | j  S )r_   )r   ra   rT   r	   r	   r   ra        
zByocTrunkInstance.fetchc                 C   s    | j j|||||||||	|
d
S )rb   )
r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   )r   rc   )r   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r	   r	   r   rc     s   zByocTrunkInstance.updatec                 C   r   )rd   )r   rf   rT   r	   r	   r   rf   
  r   zByocTrunkInstance.deletec                 C   rg   )rS   rh   c                 s   ri   rj   rk   rl   r	   r	   r   rp     rq   z-ByocTrunkInstance.__repr__.<locals>.<genexpr>z&<Twilio.Voice.V1.ByocTrunkInstance {}>rr   ru   r	   r	   r   rU     rw   zByocTrunkInstance.__repr__)N)rW   rX   rY   r   propertyr   rx   rK   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   ry   rz   r{   ra   r   rZ   rc   rf   rU   r[   r	   r	   r   r   r'   6  sX     















	
$	r'   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r?   rM   r'   r	   r	   r	   r   <module>   s    '&Y