o
    /i                     @   s   d Z ddlmZ ddlmZmZmZ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 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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Voice
    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ListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s  e Zd ZdZ	d$dedeeef dee f fddZ	e
d%d
dZdefddZdefddZd&ddZd&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eeef deeef deeef deeef deeef deeef deeef deeef deeef deeef dd 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eeef deeef deeef deeef deeef deeef deeef deeef deeef deeef dd fd d!Zdefd"d#Z  ZS )'ByocTrunkInstancea  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource.
    :ivar sid: The unique string that that we created to identify the BYOC Trunk resource.
    :ivar friendly_name: The string that you assigned to describe the resource.
    :ivar voice_url: The URL we call using the `voice_method` when the BYOC Trunk receives a call.
    :ivar voice_method: The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
    :ivar voice_fallback_url: The URL that we call when an error occurs while retrieving or executing the TwiML requested from `voice_url`.
    :ivar voice_fallback_method: The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
    :ivar status_callback_url: The URL that we call to pass status parameters (such as call ended) to your application.
    :ivar status_callback_method: The HTTP method we use to call `status_callback_url`. Either `GET` or `POST`.
    :ivar cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
    :ivar connection_policy_sid: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
    :ivar from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
    :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar url: The absolute URL of the resource.
    Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _|d| _t|d| _t|d| _|d| _d|pk| ji| _d | _d S )Naccount_sidr   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_siddate_createddate_updatedurl)super__init__getr   r   r   r   r   r   r   r   r   r   r   r   r
   iso8601_datetimer    r!   r"   	_solution_context)selfr   r   r   	__class__ Z/var/www/html/philips/venv/lib/python3.10/site-packages/twilio/rest/voice/v1/byoc_trunk.pyr$   .   s2   

zByocTrunkInstance.__init__returnByocTrunkContextc                 C   s&   | j du 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: ByocTrunkContext for this ByocTrunkInstance
        Nr   r   )r(   r/   _versionr'   r)   r,   r,   r-   _proxyN   s   
zByocTrunkInstance._proxyc                 C   
   | j  S )l
        Deletes the ByocTrunkInstance


        :returns: True if delete succeeds, False otherwise
        )r3   deleter2   r,   r,   r-   r6   ]      
zByocTrunkInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the ByocTrunkInstance


        :returns: True if delete succeeds, False otherwise
        N)r3   delete_asyncr2   r,   r,   r-   r:   f      zByocTrunkInstance.delete_asyncc                 C   r4   )_
        Fetch the ByocTrunkInstance


        :returns: The fetched ByocTrunkInstance
        )r3   fetchr2   r,   r,   r-   r=   o   r7   zByocTrunkInstance.fetchc                    r8   )y
        Asynchronous coroutine to fetch the ByocTrunkInstance


        :returns: The fetched ByocTrunkInstance
        N)r3   fetch_asyncr2   r,   r,   r-   r?   x   r;   zByocTrunkInstance.fetch_asyncr   r   r   r   r   r   r   r   r   r   c                 C   s    | j j|||||||||	|
d
S )9  
        Update the ByocTrunkInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
        :param voice_url: The URL we should call when the BYOC Trunk receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`
        :param voice_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback_url: The URL that we should call to pass status parameters (such as call ended) to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`.
        :param cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        :param connection_policy_sid: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        :param from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \"call back\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \"sip.twilio.com\".

        :returns: The updated ByocTrunkInstance
        
r   r   r   r   r   r   r   r   r   r   )r3   updater)   r   r   r   r   r   r   r   r   r   r   r,   r,   r-   rB      s   zByocTrunkInstance.updatec                    s(   | j j|||||||||	|
d
I dH S )S  
        Asynchronous coroutine to update the ByocTrunkInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
        :param voice_url: The URL we should call when the BYOC Trunk receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`
        :param voice_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback_url: The URL that we should call to pass status parameters (such as call ended) to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`.
        :param cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        :param connection_policy_sid: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        :param from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \"call back\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \"sip.twilio.com\".

        :returns: The updated ByocTrunkInstance
        rA   N)r3   update_asyncrC   r,   r,   r-   rE      s   zByocTrunkInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr,   r,   r-   	<genexpr>       z-ByocTrunkInstance.__repr__.<locals>.<genexpr>z&<Twilio.Voice.V1.ByocTrunkInstance {}>joinr'   itemsrL   r)   contextr,   r,   r-   __repr__      
zByocTrunkInstance.__repr__N)r.   r/   )r.   r   )__name__
__module____qualname____doc__r   r   strr   r   r$   propertyr3   boolr6   r:   r=   r?   r   unsetr   objectrB   rE   rX   __classcell__r,   r,   r*   r-   r      s    
 	
	
	







	



,







	



*r   c                       s  e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	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eeef deeef deeef deeef deeef deeef deeef deeef deeef deeef de	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eeef deeef deeef deeef deeef deeef deeef deeef deeef deeef de	fddZdefddZ  ZS )r/   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the ByocTrunkContext

        :param version: Version that contains the resource
        :param sid: The Twilio-provided string that uniquely identifies the BYOC Trunk resource to update.
        r   z/ByocTrunks/{sid}Nr,   )r#   r$   r'   rL   _uri)r)   r   r   r*   r,   r-   r$      s   zByocTrunkContext.__init__r.   c                 C   s   | j jd| jdS )r5   DELETEmethoduri)r1   r6   re   r2   r,   r,   r-   r6      s   zByocTrunkContext.deletec                    s   | j jd| jdI dH S )r9   rf   rg   N)r1   r:   re   r2   r,   r,   r-   r:      s
   zByocTrunkContext.delete_asyncc                 C   s(   | j jd| jd}t| j || jd dS )r<   GETrg   r   r0   )r1   r=   re   r   r'   r)   r   r,   r,   r-   r=     s   zByocTrunkContext.fetchc                    s0   | j jd| jdI dH }t| j || jd dS )r>   rj   rg   Nr   r0   )r1   r?   re   r   r'   rk   r,   r,   r-   r?     s   zByocTrunkContext.fetch_asyncr   r   r   r   r   r   r   r   r   r   c                 C   sJ   t |||||||||	|
d
}| jjd| j|d}t| j|| jd dS )r@   
FriendlyNameVoiceUrlVoiceMethodVoiceFallbackUrlVoiceFallbackMethodStatusCallbackUrlStatusCallbackMethodCnamLookupEnabledConnectionPolicySidFromDomainSidPOSTrh   ri   datar   r0   )r   ofr1   rB   re   r   r'   r)   r   r   r   r   r   r   r   r   r   r   ry   r   r,   r,   r-   rB   -  s&   zByocTrunkContext.updatec                    sR   t |||||||||	|
d
}| jjd| j|dI dH }t| j|| jd dS )rD   rl   rw   rx   Nr   r0   )r   rz   r1   rE   re   r   r'   r{   r,   r,   r-   rE   a  s(   zByocTrunkContext.update_asyncc                 C   rF   )rG   rH   c                 s   rI   rJ   rK   rM   r,   r,   r-   rQ     rR   z,ByocTrunkContext.__repr__.<locals>.<genexpr>z%<Twilio.Voice.V1.ByocTrunkContext {}>rS   rV   r,   r,   r-   rX     rY   zByocTrunkContext.__repr__)r[   r\   r]   r   r_   r$   ra   r6   r:   r   r=   r?   r   rb   r   rc   rB   rE   rX   rd   r,   r,   r*   r-   r/      s    







	



6







	



4r/   c                   @   s4   e Zd Zdeeef defddZdefddZdS )ByocTrunkPager   r.   c                 C   s   t | j|S )zo
        Build an instance of ByocTrunkInstance

        :param payload: Payload response from the API
        )r   r1   rk   r,   r,   r-   get_instance  s   zByocTrunkPage.get_instancec                 C      dS )rG   z<Twilio.Voice.V1.ByocTrunkPage>r,   r2   r,   r,   r-   rX        zByocTrunkPage.__repr__N)	r[   r\   r]   r   r_   r   r   r}   rX   r,   r,   r,   r-   r|     s    r|   c                       s  e Zd Zdef 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eee	f deee	f deee	f deee	f deee	f d	eee	f d
eee	f dee
e	f deee	f deee	f de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eee	f deee	f deee	f deee	f deee	f d	eee	f d
eee	f dee
e	f deee	f deee	f defddZ		d0dee dee dee fddZ		d0dee dee dee fddZ		d0dee dee dee fddZ		d0dee dee dee fddZejejejfdeee	f deee	f deee	f defd d!Zejejejfdeee	f deee	f deee	f defd"d#Zd$edefd%d&Zd$edefd'd(Zd)edefd*d+Zd)edefd,d-Zdefd.d/Z  Z S )1ByocTrunkListr   c                    s   t  | d| _dS )zk
        Initialize the ByocTrunkList

        :param version: Version that contains the resource

        z/ByocTrunksN)r#   r$   re   )r)   r   r*   r,   r-   r$     s   
zByocTrunkList.__init__r   r   r   r   r   r   r   r   r   r   r.   c                 C   s@   t |||||||||	|
d
}| jjd| j|d}t| j|S )aK  
        Create the ByocTrunkInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
        :param voice_url: The URL we should call when the BYOC Trunk receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
        :param voice_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback_url: The URL that we should call to pass status parameters (such as call ended) to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`.
        :param cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        :param connection_policy_sid: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        :param from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \"call back\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \"sip.twilio.com\".

        :returns: The created ByocTrunkInstance
        rl   rw   rx   )r   rz   r1   createre   r   r{   r,   r,   r-   r     s&   zByocTrunkList.createc                    sH   t |||||||||	|
d
}| jjd| j|dI dH }t| j|S )aZ  
        Asynchronously create the ByocTrunkInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
        :param voice_url: The URL we should call when the BYOC Trunk receives a call.
        :param voice_method: The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
        :param voice_fallback_url: The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`.
        :param voice_fallback_method: The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
        :param status_callback_url: The URL that we should call to pass status parameters (such as call ended) to your application.
        :param status_callback_method: The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`.
        :param cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information.
        :param connection_policy_sid: The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
        :param from_domain_sid: The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \"call back\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \"sip.twilio.com\".

        :returns: The created ByocTrunkInstance
        rl   rw   rx   N)r   rz   r1   create_asyncre   r   r{   r,   r,   r-   r     s(   zByocTrunkList.create_asyncNlimit	page_sizec                 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        r   r   r   )r1   read_limitspagestreamr)   r   r   limitsr   r,   r,   r-   r   %  s   zByocTrunkList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )an  
        Asynchronously 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        r   r   Nr   )r1   r   
page_asyncstream_asyncr   r,   r,   r-   r   >  s   zByocTrunkList.stream_asyncc                 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 limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        r   r   )listr   r)   r   r   r,   r,   r-   r   W  s   zByocTrunkList.listc                    s&   dd | j ||dI dH 2 I dH S )a  
        Asynchronously 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 limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S rZ   r,   )rN   recordr,   r,   r-   
<listcomp>  s
    z,ByocTrunkList.list_async.<locals>.<listcomp>r   N)r   r   r,   r,   r-   
list_asyncq  s   
zByocTrunkList.list_async
page_tokenpage_numberc                 C   s2   t |||d}| jjd| j|d}t| j|S )aw  
        Retrieve a single page of ByocTrunkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ByocTrunkInstance
        	PageTokenr   PageSizerj   rh   ri   params)r   rz   r1   r   re   r|   r)   r   r   r   ry   responser,   r,   r-   r     s   zByocTrunkList.pagec                    s:   t |||d}| jjd| j|dI dH }t| j|S )a  
        Asynchronously retrieve a single page of ByocTrunkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ByocTrunkInstance
        r   rj   r   N)r   rz   r1   r   re   r|   r   r,   r,   r-   r     s   zByocTrunkList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of ByocTrunkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ByocTrunkInstance
        rj   )r1   domaintwiliorequestr|   r)   r   r   r,   r,   r-   get_page  s   	zByocTrunkList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of ByocTrunkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ByocTrunkInstance
        rj   N)r1   r   r   request_asyncr|   r   r,   r,   r-   get_page_async  s   	zByocTrunkList.get_page_asyncr   c                 C      t | j|dS z
        Constructs a ByocTrunkContext

        :param sid: The Twilio-provided string that uniquely identifies the BYOC Trunk resource to update.
        r0   r/   r1   r)   r   r,   r,   r-   r%        zByocTrunkList.getc                 C   r   r   r   r   r,   r,   r-   __call__  r   zByocTrunkList.__call__c                 C   r~   )rG   z<Twilio.Voice.V1.ByocTrunkList>r,   r2   r,   r,   r-   rX     r   zByocTrunkList.__repr__)NN)!r[   r\   r]   r   r$   r   rb   r   r_   rc   ra   r   r   r   r   intr   r   r	   r   r   r   r   r|   r   r   r   r   r/   r%   r   rX   rd   r,   r,   r*   r-   r     s
   







	



6







	



6











r   N)r^   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r/   r|   r   r,   r,   r,   r-   <module>   s    $ F A