
    pia                         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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 - Proxy
    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	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec            
            e Zd Zd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ej$                  fdeeef   dd fdZej$                  fdeeef   dd fdZdefdZ xZS )PhoneNumberInstancea  
    :ivar sid: The unique string that we created to identify the PhoneNumber resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource.
    :ivar service_sid: The SID of the PhoneNumber resource's parent [Service](https://www.twilio.com/docs/proxy/api/service) resource.
    :ivar date_created: The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created.
    :ivar date_updated: The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated.
    :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
    :ivar friendly_name: The string that you assigned to describe the resource.
    :ivar iso_country: The ISO Country Code for the phone number.
    :ivar capabilities:
    :ivar url: The absolute URL of the PhoneNumber resource.
    :ivar is_reserved: Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.
    :ivar in_use: The number of open session assigned to the number. See the [How many Phone Numbers do I need?](https://www.twilio.com/docs/proxy/phone-numbers-needed) guide for more information.
    versionpayloadservice_sidsidc                    t         |   |       |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      | _        t        j                   |j                  d            | _        ||xs | j                  d| _        d | _        y )Nr   account_sidr   date_createddate_updatedphone_numberfriendly_nameiso_countrycapabilitiesurlis_reservedin_user   r   )super__init__getr   r   r   r   iso8601_datetimer   r   r   r   r   r    r!   r"   integerr#   	_solution_context)selfr   r   r   r   	__class__s        k/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/proxy/v1/service/phone_number.pyr&   zPhoneNumberInstance.__init__)   s(    	!")++e"4*1++m*D*1++m*D0;0L0LKK'1
 1<0L0LKK'1
 ,3;;~+F,3KK,H*1++m*D+2;;~+F")++e"4+2;;}+E%0%8%8X9N%O '?$((
 7;    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   r$   )r+   PhoneNumberContext_versionr*   r,   s    r.   _proxyzPhoneNumberInstance._proxyI   sE     == . NN=9NN5)DM
 }}r/   c                 6    | j                   j                         S )n
        Deletes the PhoneNumberInstance


        :returns: True if delete succeeds, False otherwise
        )r5   deleter4   s    r.   r8   zPhoneNumberInstance.deleteY   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)r5   delete_asyncr4   s    r.   r;   z PhoneNumberInstance.delete_asyncb   s!      [[--////   '%'c                 6    | j                   j                         S )c
        Fetch the PhoneNumberInstance


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


        :returns: The fetched PhoneNumberInstance
        N)r5   fetch_asyncr4   s    r.   rB   zPhoneNumberInstance.fetch_asynct   s!      [[,,....r<   r"   c                 :    | j                   j                  |      S )V  
        Update the PhoneNumberInstance

        :param is_reserved: Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.

        :returns: The updated PhoneNumberInstance
        r"   )r5   updater,   r"   s     r.   rF   zPhoneNumberInstance.update}   s#     {{!!# " 
 	
r/   c                 V   K   | j                   j                  |       d{   S 7 w)p  
        Asynchronous coroutine to update the PhoneNumberInstance

        :param is_reserved: Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.

        :returns: The updated PhoneNumberInstance
        rE   N)r5   update_asyncrG   s     r.   rJ   z PhoneNumberInstance.update_async   s1      [[--# . 
 
 	
 
s    )')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.Proxy.V1.PhoneNumberInstance {}>joinr*   itemsrQ   r,   contexts     r.   __repr__zPhoneNumberInstance.__repr__   s6     ((SDNN<P<P<RSS9@@IIr/   )N)r0   r2   )r0   r   )__name__
__module____qualname____doc__r   r   strr   r   r&   propertyr5   boolr8   r;   r?   rB   r   unsetr   objectrF   rJ   r^   __classcell__r-   s   @r.   r   r      s    ( ";; c3h; 	;
 c];@  $ $0D 0#/ 28
 v.
	
 28
 v.
	
J# Jr/   r   c                        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ej                  fd
eeef   de	fdZej                  fd
eeef   de	fdZdefdZ xZS )r2   r   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)am  
        Initialize the PhoneNumberContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) of the PhoneNumber resource to update.
        :param sid: The Twilio-provided string that uniquely identifies the PhoneNumber resource to update.
        r$   z*/Services/{service_sid}/PhoneNumbers/{sid}N r%   r&   r*   rQ   _uri)r,   r   r   r   r-   s       r.   r&   zPhoneNumberContext.__init__   sG     	! '
 H@GG 
nn
	r/   r0   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r7   DELETEmethoduriheaders)r   ofr3   r8   rn   r,   rt   s     r.   r8   zPhoneNumberContext.delete   s1     ))B-}}##8G#TTr/   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r:   rp   rq   N)r   ru   r3   r;   rn   rv   s     r.   r;   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 )r>   application/jsonAcceptGETrq   r   r   r$   )r   ru   r3   r?   rn   r   r*   r,   rt   r   s      r.   r?   zPhoneNumberContext.fetch   si     ))B-.--%%U		7%S"MM}5u%	
 	
r/   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rA   ry   rz   r{   rq   Nr   r   r$   )r   ru   r3   rB   rn   r   r*   r|   s      r.   rB   zPhoneNumberContext.fetch_async   s~      ))B-.11dii 2 
 
 #MM}5u%	
 	
	
s   ABB 	8Br"   c                 L   t        j                  dt        j                  |      i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d	   
      S )rD   
IsReserved!application/x-www-form-urlencodedContent-Typery   rz   POSTrr   rs   datart   r   r   r$   )	r   ru   r   boolean_to_stringr3   rF   rn   r   r*   r,   r"   r   rt   r   s        r.   rF   zPhoneNumberContext.update   s     yyi99+F

 ))B-"E.--&&tyytW ' 
 #MM}5u%	
 	
r/   c                 h  K   t        j                  dt        j                  |      i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   | j                  d
         S 7 7w)rI   r   r   r   ry   rz   r   r   Nr   r   r$   )	r   ru   r   r   r3   rJ   rn   r   r*   r   s        r.   rJ   zPhoneNumberContext.update_async  s      yyi99+F

 ))B-"E.22tyytW 3 
 
 #MM}5u%	
 	
	
s   A6B28B098B2c                     dj                  d | j                  j                         D              }dj                  |      S )rL   rM   c              3   F   K   | ]  \  }}d j                  ||        ywrO   rP   rR   s      r.   rV   z.PhoneNumberContext.__repr__.<locals>.<genexpr>F  rW   rX   z'<Twilio.Proxy.V1.PhoneNumberContext {}>rY   r\   s     r.   r^   zPhoneNumberContext.__repr__@  s6     ((SDNN<P<P<RSS8??HHr/   )r_   r`   ra   r   rc   r&   re   r8   r;   r   r?   rB   r   rf   r   rg   rF   rJ   r^   rh   ri   s   @r.   r2   r2      s    
 
c 
 
&
U 
U
D 

* 
*
#6 
0 28
 v.
	
D 28
 v.
	
BI# Ir/   r2   c                   2    e Zd Zdeeef   defdZdefdZy)PhoneNumberPager   r0   c                 L    t        | j                  || j                  d         S )zq
        Build an instance of PhoneNumberInstance

        :param payload: Payload response from the API
        r   r   )r   r3   r*   )r,   r   s     r.   get_instancezPhoneNumberPage.get_instanceL  s%     #MM7}0M
 	
r/   c                      y)rL   z!<Twilio.Proxy.V1.PhoneNumberPage>rl   r4   s    r.   r^   zPhoneNumberPage.__repr__V       3r/   N)	r_   r`   ra   r   rc   r   r   r   r^   rl   r/   r.   r   r   J  s*    
DcN 
7J 
3# 3r/   r   c            	           e Zd Zdedef 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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 service_sid: The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) of the PhoneNumber resources to read.

        r   z$/Services/{service_sid}/PhoneNumbersNrl   rm   )r,   r   r   r-   s      r.   r&   zPhoneNumberList.__init__a  sA     	! ;
 B:AASDNNS	r/   r   r   r"   r0   c                 8   t        j                  ||t        j                  |      d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   	      S )
aB  
        Create the PhoneNumberInstance

        :param sid: The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service.
        :param phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.  E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.
        :param is_reserved: Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.

        :returns: The created PhoneNumberInstance
        SidPhoneNumberr   r   r   ry   rz   r   r   r   r   )	r   ru   r   r   r3   creatern   r   r*   r,   r   r   r"   r   rt   r   s          r.   r   zPhoneNumberList.createq  s      yy+'99+F
 ))^-PQR"E.--&&tyytW ' 
 #MM7}0M
 	
r/   c                 T  K   t        j                  ||t        j                  |      d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   
      S 7 )w)aQ  
        Asynchronously create the PhoneNumberInstance

        :param sid: The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service.
        :param phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.  E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.
        :param is_reserved: Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information.

        :returns: The created PhoneNumberInstance
        r   r   r   ry   rz   r   r   Nr   r   )	r   ru   r   r   r3   create_asyncrn   r   r*   r   s          r.   r   zPhoneNumberList.create_async  s       yy+'99+F
 ))^-PQR"E.22tyytW 3 
 
 #MM7}0M
 	
	
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   )r3   read_limitspagestreamr,   r   r   limitsr   s        r.   r   zPhoneNumberList.stream  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   )r3   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   )r,   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   )r,   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   ry   rz   r{   rr   rs   paramsrt   )r   ru   r3   r   rn   r   r*   r,   r   r   r   r   rt   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   ry   rz   r{   r   N)r   ru   r3   r   rn   r   r*   r   s          r.   r   zPhoneNumberList.page_asyncC  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{   )r3   domaintwiliorequestr   r*   r,   r   r   s      r.   get_pagezPhoneNumberList.get_paged  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)r3   r   r   request_asyncr   r*   r   s      r.   get_page_asynczPhoneNumberList.get_page_asyncp  sJ      --44BB5*UUt}}hGG Vs   4AA&Ac                 L    t        | j                  | j                  d   |      S z
        Constructs a PhoneNumberContext

        :param sid: The Twilio-provided string that uniquely identifies the PhoneNumber resource to update.
        r   r$   r2   r3   r*   r,   r   s     r.   r'   zPhoneNumberList.get|  %     "MMt~~m'D#
 	
r/   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r.   __call__zPhoneNumberList.__call__  r   r/   c                      y)rL   z!<Twilio.Proxy.V1.PhoneNumberList>rl   r4   s    r.   r^   zPhoneNumberList.__repr__  r   r/   )NN)!r_   r`   ra   r   rc   r&   r   rf   r   rg   re   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   r2   r'   r   r^   rh   ri   s   @r.   r   r   _  s   T Tc T$ #),,+1<<+1<<	#
3;#
 CK(#
 4<(	#

 
#
N #),,+1<<+1<<	#
3;#
 CK(#
 4<(	#

 
#
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 
3# 3r/   r   N)rb   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r2   r   r   rl   r/   r.   <module>r      sj     L L L 6 6 8 : 2 ' !GJ* GJTdI dIN3d 3*w3l w3r/   