
    piZ                         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e      Z G d de      Z G d de      Z G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Trunking
    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            
            e Zd Z G d de      Z	 	 ddedeeef   dede	e   f fdZ
edd	       Zdefd
ZdefdZddZddZdefdZ xZS )PhoneNumberInstancec                       e Zd ZdZdZdZdZy)&PhoneNumberInstance.AddressRequirementnoneanylocalforeignN)__name__
__module____qualname__NONEANYLOCALFOREIGN     l/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/trunking/v1/trunk/phone_number.pyAddressRequirementr      s    r"   r$   versionpayload	trunk_sidsidc                 &   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _
        t        j                  |j                  d            | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        ||xs | j                  d| _        d | _         y )Naccount_sidaddress_requirementsapi_versionbetacapabilitiesdate_createddate_updatedfriendly_namelinksphone_numberr(   sms_application_sidsms_fallback_methodsms_fallback_url
sms_methodsms_urlstatus_callbackstatus_callback_methodr'   urlvoice_application_sidvoice_caller_id_lookupvoice_fallback_methodvoice_fallback_urlvoice_method	voice_urlr'   r(   )!super__init__getr*   r+   r,   r-   r.   r   iso8601_datetimer/   r0   r1   r2   r3   r(   r4   r5   r6   r7   r8   r9   r:   r'   r;   r<   r=   r>   r?   r@   rA   	_solution_context)selfr%   r&   r'   r(   	__class__s        r#   rD   zPhoneNumberInstance.__init__>   s    	!*1++m*D KK./ 	! +2++m*D$+KK$7	+2;;~+F0;0L0LKK'1
 1<0L0LKK'1
 -4KK,H29++g2F
+2;;~+F")++e"429++>S2T 29++>S2T /6{{;M/N)0\)B&-kk)&<.5kk:K.L5<[[$6
# )0K(@")++e"44;KK@W4X"6=kk$7
# 5<KK@W4X"18=Q1R+2;;~+F(/K(@ #?$((
 7;r"   returnc                     | j                   7t        | j                  | j                  d   | j                  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: PhoneNumberContext for this PhoneNumberInstance
        r'   r(   rB   )rH   PhoneNumberContext_versionrG   rI   s    r#   _proxyzPhoneNumberInstance._proxyr   sE     == ...5NN5)DM
 }}r"   c                 6    | j                   j                         S )n
        Deletes the PhoneNumberInstance


        :returns: True if delete succeeds, False otherwise
        )rP   deleterO   s    r#   rS   zPhoneNumberInstance.delete   s     {{!!##r"   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the PhoneNumberInstance


        :returns: True if delete succeeds, False otherwise
        N)rP   delete_asyncrO   s    r#   rV   z PhoneNumberInstance.delete_async   s!      [[--////   '%'c                 6    | j                   j                         S )c
        Fetch the PhoneNumberInstance


        :returns: The fetched PhoneNumberInstance
        )rP   fetchrO   s    r#   rZ   zPhoneNumberInstance.fetch   s     {{  ""r"   c                 R   K   | j                   j                          d{   S 7 w)}
        Asynchronous coroutine to fetch the PhoneNumberInstance


        :returns: The fetched PhoneNumberInstance
        N)rP   fetch_asyncrO   s    r#   r]   zPhoneNumberInstance.fetch_async   s!      [[,,....rW   c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r#   	<genexpr>z/PhoneNumberInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z+<Twilio.Trunking.V1.PhoneNumberInstance {}>joinrG   itemsrd   rI   contexts     r#   __repr__zPhoneNumberInstance.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr"   )N)rK   rM   )rK   r   )r   r   r   objectr$   r   r   strr   r   rD   propertyrP   boolrS   rV   rZ   r]   rq   __classcell__rJ   s   @r#   r   r      s    V D "2;2; c3h2; 	2;
 c]2;h  $ $0D 0#/M# Mr"   r   c                   h     e Zd Zdededef fdZdefdZdefdZde	fdZ
de	fd	Zdefd
Z xZS )rM   r%   r'   r(   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a1  
        Initialize the PhoneNumberContext

        :param version: Version that contains the resource
        :param trunk_sid: The SID of the Trunk from which to fetch the PhoneNumber resource.
        :param sid: The unique string that we created to identify the PhoneNumber resource to fetch.
        rB   z&/Trunks/{trunk_sid}/PhoneNumbers/{sid}Nr!   rC   rD   rG   rd   _uri)rI   r%   r'   r(   rJ   s       r#   rD   zPhoneNumberContext.__init__   sB     	! #
 D<CCUdnnU	r"   rK   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rR   DELETEmethoduriheaders)r   ofrN   rS   r{   rI   r   s     r#   rS   zPhoneNumberContext.delete   s1     ))B-}}##8G#TTr"   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rU   r}   r~   N)r   r   rN   rV   r{   r   s     r#   rV   zPhoneNumberContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rY   application/jsonAcceptGETr~   r'   r(   rB   )r   r   rN   rZ   r{   r   rG   rI   r   r&   s      r#   rZ   zPhoneNumberContext.fetch   si     ))B-.--%%U		7%S"MMnn[1u%	
 	
r"   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	r\   r   r   r   r~   Nr'   r(   rB   )r   r   rN   r]   r{   r   rG   r   s      r#   r]   zPhoneNumberContext.fetch_async   s~      ))B-.11dii 2 
 
 #MMnn[1u%	
 	
	
s   ABB 	8Bc                     dj                  d | j                  j                         D              }dj                  |      S )r_   r`   c              3   F   K   | ]  \  }}d j                  ||        ywrb   rc   re   s      r#   ri   z.PhoneNumberContext.__repr__.<locals>.<genexpr>  rj   rk   z*<Twilio.Trunking.V1.PhoneNumberContext {}>rl   ro   s     r#   rq   zPhoneNumberContext.__repr__	  s6     ((SDNN<P<P<RSS;BB7KKr"   )r   r   r   r   rs   rD   ru   rS   rV   r   rZ   r]   rq   rv   rw   s   @r#   rM   rM      sc    V VC Vc V"
U 
U
D 

* 
*
#6 
.L# Lr"   rM   c                   2    e Zd Zdeeef   defdZdefdZy)PhoneNumberPager&   rK   c                 L    t        | j                  || j                  d         S )zq
        Build an instance of PhoneNumberInstance

        :param payload: Payload response from the API
        r'   r'   )r   rN   rG   )rI   r&   s     r#   get_instancezPhoneNumberPage.get_instance  s%     #MM7dnn[.I
 	
r"   c                      y)r_   z$<Twilio.Trunking.V1.PhoneNumberPage>r!   rO   s    r#   rq   zPhoneNumberPage.__repr__       6r"   N)	r   r   r   r   rs   r   r   r   rq   r!   r"   r#   r   r     s*    
DcN 
7J 
6# 6r"   r   c            	       8    e Zd Zdedef fdZdedefdZdedefdZ	 	 dde	e
   d	e	e
   dee   fd
Z	 	 dde	e
   d	e	e
   dee   fdZ	 	 dde	e
   d	e	e
   dee   fdZ	 	 dde	e
   d	e	e
   dee   f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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ZdedefdZdedefdZdedefdZdedefdZdefdZ xZS )PhoneNumberListr%   r'   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the PhoneNumberList

        :param version: Version that contains the resource
        :param trunk_sid: The SID of the Trunk from which to read the PhoneNumber resources.

        r'   z /Trunks/{trunk_sid}/PhoneNumbersNr!   rz   )rI   r%   r'   rJ   s      r#   rD   zPhoneNumberList.__init__*  s@     	! 
 >6==OO	r"   phone_number_sidrK   c                    t        j                  d|i      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   	      S )
a#  
        Create the PhoneNumberInstance

        :param phone_number_sid: The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk.

        :returns: The created PhoneNumberInstance
        PhoneNumberSidContent-Type!application/x-www-form-urlencodedr   r   POSTr   r   datar   r'   r   )r   r   rN   creater{   r   rG   rI   r   r   r   r&   s        r#   r   zPhoneNumberList.create:  s     yy "2

 ))^-PQR"E.--&&tyytW ' 
 #MM7dnn[.I
 	
r"   c                 *  K   t        j                  d|i      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   
      S 7 )w)a2  
        Asynchronously create the PhoneNumberInstance

        :param phone_number_sid: The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk.

        :returns: The created PhoneNumberInstance
        r   r   r   r   r   r   r   Nr'   r   )r   r   rN   create_asyncr{   r   rG   r   s        r#   r   zPhoneNumberList.create_asyncV  s      yy "2

 ))^-PQR"E.22tyytW 3 
 
 #MM7dnn[.I
 	
	
s   A%B'B(*Blimit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )aa  
        Streams PhoneNumberInstance 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   )rN   read_limitspagestreamrI   r   r   limitsr   s        r#   r   zPhoneNumberList.streamr  sJ    ( **5)<yy6+#6y7}}##D&/::r"   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ap  
        Asynchronously streams PhoneNumberInstance 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   )rN   r   
page_asyncstream_asyncr   s        r#   r   zPhoneNumberList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists PhoneNumberInstance 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   )rI   r   r   s      r#   r   zPhoneNumberList.list  s(    & KK#  
 	
r"   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists PhoneNumberInstance 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   N)r   )rI   r   r   records       r#   
list_asynczPhoneNumberList.list_async  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )a{  
        Retrieve a single page of PhoneNumberInstance 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 PhoneNumberInstance
        	PageTokenr   PageSizer   r   r   r   r   r   r   paramsr   )r   r   rN   r   r{   r   rG   rI   r   r   r   r   r   responses          r#   r   zPhoneNumberList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 t}}hGGr"   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a  
        Asynchronously retrieve a single page of PhoneNumberInstance 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 PhoneNumberInstance
        r   r   r   r   r   r   r   N)r   r   rN   r   r{   r   rG   r   s          r#   r   zPhoneNumberList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 t}}hGG
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of PhoneNumberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PhoneNumberInstance
        r   )rN   domaintwiliorequestr   rG   rI   r   r   s      r#   get_pagezPhoneNumberList.get_page  s=     ==''..66ujIt}}hGGr"   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a
  
        Asynchronously retrieve a specific page of PhoneNumberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PhoneNumberInstance
        r   N)rN   r   r   request_asyncr   rG   r   s      r#   get_page_asynczPhoneNumberList.get_page_async'  sJ      --44BB5*UUt}}hGG Vs   4AA&Ar(   c                 L    t        | j                  | j                  d   |      S z
        Constructs a PhoneNumberContext

        :param sid: The unique string that we created to identify the PhoneNumber resource to fetch.
        r'   rB   rM   rN   rG   rI   r(   s     r#   rE   zPhoneNumberList.get3  %     "MMT^^K%@c
 	
r"   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r#   __call__zPhoneNumberList.__call__=  r   r"   c                      y)r_   z$<Twilio.Trunking.V1.PhoneNumberList>r!   rO   s    r#   rq   zPhoneNumberList.__repr__G  r   r"   )NN) r   r   r   r   rs   rD   r   r   r   r   intr	   r   r
   r   r   r   r   r   unsetr   rr   r   r   r   r   r   rM   rE   r   rq   rv   rw   s   @r#   r   r   (  sG   P PC P 
s 
/B 
8
3 
;N 
<  $#';}; C=; 
%	&	;6  $#'A}A C=A 
*	+	A6  $#'
}
 C=
 
!	"	
8  $#'
}
 C=
 
!	"	
: *0*0,,(.	H#v+&H 3;'H f%	H
 
HF *0*0,,(.	H#v+&H 3;'H f%	H
 
HB
H3 
H? 
H
Hs 
H 
H
s 
1 

C 
$6 
6# 6r"   r   N)__doc__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   rM   r   r   r!   r"   r#   <module>r      sg     L L L + 8 : 2 ' !TM* TMn`L `LF6d 6*e6l e6r"   