o
    �¨ÊhðD  ã                   @   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                       sr   e Zd ZdZ‡ fdd„Z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 )ÚPhoneNumberListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a5  
        Initialize the PhoneNumberList

        :param Version version: Version that contains the resource
        :param trunk_sid: The trunk_sid

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberList
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberList
        Ú	trunk_sidz /Trunks/{trunk_sid}/PhoneNumbersN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   ú\/var/www/html/env/lib/python3.10/site-packages/twilio/rest/trunking/v1/trunk/phone_number.pyr      s   

zPhoneNumberList.__init__c                 C   s8   t  d|i¡}| jjd| j|d�}t| j|| jd d�S )a1  
        Create a new PhoneNumberInstance

        :param unicode phone_number_sid: The SID of the Incoming Phone Number that you want to associate with this trunk.

        :returns: Newly created PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        ÚPhoneNumberSidÚPOST)Údatar
   ©r
   )r   ÚofÚ_versionÚcreater   ÚPhoneNumberInstancer   )r   Úphone_number_sidr   Úpayloadr   r   r   r   $   s   	ýzPhoneNumberList.createNc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aÎ  
        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 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.trunking.v1.trunk.phone_number.PhoneNumberInstance]
        Ú	page_size)r    ÚlimitÚ
page_limit)r   Úread_limitsÚpageÚstream)r   r!   r    Úlimitsr$   r   r   r   r%   7   s   zPhoneNumberList.streamc                 C   s   t | j||d�ƒS )an  
        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 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.trunking.v1.trunk.phone_number.PhoneNumberInstance]
        )r!   r    )Úlistr%   )r   r!   r    r   r   r   r'   N   s   zPhoneNumberList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÒ  
        Retrieve a single page of PhoneNumberInstance 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 PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   r   r   r$   r   ÚPhoneNumberPager   )r   Ú
page_tokenÚpage_numberr    r,   Úresponser   r   r   r$   `   s   ýzPhoneNumberList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aJ  
        Retrieve a specific page of PhoneNumberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberPage
        r*   )r   ÚdomainÚtwilioÚrequestr-   r   )r   Ú
target_urlr0   r   r   r   Úget_pagew   s
   

þzPhoneNumberList.get_pagec                 C   ó   t | j| jd |d�S ©zí
        Constructs a PhoneNumberContext

        :param sid: The sid

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        r
   ©r
   Úsid©ÚPhoneNumberContextr   r   ©r   r9   r   r   r   Úgetˆ   ó   	zPhoneNumberList.getc                 C   r6   r7   r:   r<   r   r   r   Ú__call__“   r>   zPhoneNumberList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Trunking.V1.PhoneNumberList>r   ©r   r   r   r   Ú__repr__ž   ó   zPhoneNumberList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r%   r'   r   Úunsetr$   r5   r=   r?   rC   Ú__classcell__r   r   r   r   r      s    


ÿr   c                       s0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r-   r	   c                    s   t t| ƒ ||¡ || _dS )am  
        Initialize the PhoneNumberPage

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

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberPage
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberPage
        N)r   r-   r   r   )r   r   r0   Úsolutionr   r   r   r   «   s   
zPhoneNumberPage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of PhoneNumberInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        r
   r   )r   r   r   )r   r   r   r   r   Úget_instance»   r>   zPhoneNumberPage.get_instancec                 C   r@   )rA   z$<Twilio.Trunking.V1.PhoneNumberPage>r   rB   r   r   r   rC   Æ   rD   zPhoneNumberPage.__repr__)rE   rF   rG   rH   r   rL   rC   rJ   r   r   r   r   r-   ¨   s
    r-   c                       s8   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Z‡  ZS )
r;   r	   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )aZ  
        Initialize the PhoneNumberContext

        :param Version version: Version that contains the resource
        :param trunk_sid: The trunk_sid
        :param sid: The sid

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        r8   z&/Trunks/{trunk_sid}/PhoneNumbers/{sid}Nr   )r   r;   r   r   r   r   )r   r   r
   r9   r   r   r   r   Ó   s   zPhoneNumberContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú«
        Fetch a PhoneNumberInstance

        :returns: Fetched PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        r*   r+   r
   r9   r8   )r   r   r   Úfetchr   r   r   )r   r,   r   r   r   r   rN   ä   s   
ýüzPhoneNumberContext.fetchc                 C   s   | j  d| j¡S )ú‚
        Deletes the PhoneNumberInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rP   r   rB   r   r   r   rP   ú   s   zPhoneNumberContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rA   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>
  ó   € z.PhoneNumberContext.__repr__.<locals>.<genexpr>z*<Twilio.Trunking.V1.PhoneNumberContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rC     ó   
zPhoneNumberContext.__repr__)	rE   rF   rG   rH   r   rN   rP   rC   rJ   r   r   r   r   r;   Ð   s    	r;   c                       sŽ  e Zd ZdZG dd„ deƒZdC‡ 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ed'd(„ ƒZed)d*„ ƒZed+d,„ ƒZed-d.„ ƒZed/d0„ ƒZed1d2„ ƒZed3d4„ ƒZed5d6„ ƒZed7d8„ ƒZ ed9d:„ ƒZ!ed;d<„ ƒZ"d=d>„ Z#d?d@„ Z$dAdB„ Z%‡  Z&S )Dr   r	   c                   @   s   e Zd ZdZdZdZdZdS )z&PhoneNumberInstance.AddressRequirementÚnoneÚanyÚlocalÚforeignN)rE   rF   rG   ÚNONEÚANYÚLOCALÚFOREIGNr   r   r   r   ÚAddressRequirement  s
    rj   Nc                    s(  t t| ƒ |¡ i d|d “d|d “d|d “d|d “d|d “dt |d ¡“dt |d ¡“d|d “d	|d	 “d
|d
 “d|d “d|d “d|d “d|d “d|d “d|d “d|d “|d |d |d |d |d |d |d |d |d dœ	¥| _d| _||pŽ| jd dœ| _dS )zÕ
        Initialize the PhoneNumberInstance

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        Úaccount_sidÚaddress_requirementsÚapi_versionÚbetaÚcapabilitiesÚdate_createdÚdate_updatedÚfriendly_nameÚlinksÚphone_numberr9   Ú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
   r|   r}   r~   r   r€   r�   r‚   Nr8   )r   r   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r   r
   r9   r   r   r   r     s`   ÿþýüûúùø	÷
öõôóòñðï
æzPhoneNumberInstance.__init__c                 C   s.   | j du rt| j| jd | 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: PhoneNumberContext for this PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        Nr
   r9   r8   )r…   r;   r   r   rB   r   r   r   Ú_proxyB  s   
	ýzPhoneNumberInstance._proxyc                 C   ó
   | j d S )zC
        :returns: The account_sid
        :rtype: unicode
        rk   ©r„   rB   r   r   r   rk   S  ó   
zPhoneNumberInstance.account_sidc                 C   r‡   )zk
        :returns: The address_requirements
        :rtype: PhoneNumberInstance.AddressRequirement
        rl   rˆ   rB   r   r   r   rl   [  r‰   z(PhoneNumberInstance.address_requirementsc                 C   r‡   )zC
        :returns: The api_version
        :rtype: unicode
        rm   rˆ   rB   r   r   r   rm   c  r‰   zPhoneNumberInstance.api_versionc                 C   r‡   )z9
        :returns: The beta
        :rtype: bool
        rn   rˆ   rB   r   r   r   rn   k  r‰   zPhoneNumberInstance.betac                 C   r‡   )zD
        :returns: The capabilities
        :rtype: unicode
        ro   rˆ   rB   r   r   r   ro   s  r‰   z PhoneNumberInstance.capabilitiesc                 C   r‡   )zE
        :returns: The date_created
        :rtype: datetime
        rp   rˆ   rB   r   r   r   rp   {  r‰   z PhoneNumberInstance.date_createdc                 C   r‡   )zE
        :returns: The date_updated
        :rtype: datetime
        rq   rˆ   rB   r   r   r   rq   ƒ  r‰   z PhoneNumberInstance.date_updatedc                 C   r‡   )zE
        :returns: The friendly_name
        :rtype: unicode
        rr   rˆ   rB   r   r   r   rr   ‹  r‰   z!PhoneNumberInstance.friendly_namec                 C   r‡   )z=
        :returns: The links
        :rtype: unicode
        rs   rˆ   rB   r   r   r   rs   “  r‰   zPhoneNumberInstance.linksc                 C   r‡   )zD
        :returns: The phone_number
        :rtype: unicode
        rt   rˆ   rB   r   r   r   rt   ›  r‰   z PhoneNumberInstance.phone_numberc                 C   r‡   )z;
        :returns: The sid
        :rtype: unicode
        r9   rˆ   rB   r   r   r   r9   £  r‰   zPhoneNumberInstance.sidc                 C   r‡   )zK
        :returns: The sms_application_sid
        :rtype: unicode
        ru   rˆ   rB   r   r   r   ru   «  r‰   z'PhoneNumberInstance.sms_application_sidc                 C   r‡   )zK
        :returns: The sms_fallback_method
        :rtype: unicode
        rv   rˆ   rB   r   r   r   rv   ³  r‰   z'PhoneNumberInstance.sms_fallback_methodc                 C   r‡   )zH
        :returns: The sms_fallback_url
        :rtype: unicode
        rw   rˆ   rB   r   r   r   rw   »  r‰   z$PhoneNumberInstance.sms_fallback_urlc                 C   r‡   )zB
        :returns: The sms_method
        :rtype: unicode
        rx   rˆ   rB   r   r   r   rx   Ã  r‰   zPhoneNumberInstance.sms_methodc                 C   r‡   )z?
        :returns: The sms_url
        :rtype: unicode
        ry   rˆ   rB   r   r   r   ry   Ë  r‰   zPhoneNumberInstance.sms_urlc                 C   r‡   )zG
        :returns: The status_callback
        :rtype: unicode
        rz   rˆ   rB   r   r   r   rz   Ó  r‰   z#PhoneNumberInstance.status_callbackc                 C   r‡   )zN
        :returns: The status_callback_method
        :rtype: unicode
        r{   rˆ   rB   r   r   r   r{   Û  r‰   z*PhoneNumberInstance.status_callback_methodc                 C   r‡   )zA
        :returns: The trunk_sid
        :rtype: unicode
        r
   rˆ   rB   r   r   r   r
   ã  r‰   zPhoneNumberInstance.trunk_sidc                 C   r‡   )z;
        :returns: The url
        :rtype: unicode
        r|   rˆ   rB   r   r   r   r|   ë  r‰   zPhoneNumberInstance.urlc                 C   r‡   )zM
        :returns: The voice_application_sid
        :rtype: unicode
        r}   rˆ   rB   r   r   r   r}   ó  r‰   z)PhoneNumberInstance.voice_application_sidc                 C   r‡   )zK
        :returns: The voice_caller_id_lookup
        :rtype: bool
        r~   rˆ   rB   r   r   r   r~   û  r‰   z*PhoneNumberInstance.voice_caller_id_lookupc                 C   r‡   )zM
        :returns: The voice_fallback_method
        :rtype: unicode
        r   rˆ   rB   r   r   r   r     r‰   z)PhoneNumberInstance.voice_fallback_methodc                 C   r‡   )zJ
        :returns: The voice_fallback_url
        :rtype: unicode
        r€   rˆ   rB   r   r   r   r€     r‰   z&PhoneNumberInstance.voice_fallback_urlc                 C   r‡   )zD
        :returns: The voice_method
        :rtype: unicode
        r�   rˆ   rB   r   r   r   r�     r‰   z PhoneNumberInstance.voice_methodc                 C   r‡   )zA
        :returns: The voice_url
        :rtype: unicode
        r‚   rˆ   rB   r   r   r   r‚     r‰   zPhoneNumberInstance.voice_urlc                 C   ó
   | j  ¡ S )rM   )r†   rN   rB   r   r   r   rN   #  ó   
zPhoneNumberInstance.fetchc                 C   rŠ   )rO   )r†   rP   rB   r   r   r   rP   ,  r‹   zPhoneNumberInstance.deletec                 C   rQ   )rA   rR   c                 s   rS   rT   rU   rV   r   r   r   rZ   <  r[   z/PhoneNumberInstance.__repr__.<locals>.<genexpr>z+<Twilio.Trunking.V1.PhoneNumberInstance {}>r\   r_   r   r   r   rC   5  ra   zPhoneNumberInstance.__repr__)N)'rE   rF   rG   rH   Úobjectrj   r   Úpropertyr†   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   r9   ru   rv   rw   rx   ry   rz   r{   r
   r|   r}   r~   r   r€   r�   r‚   rN   rP   rC   rJ   r   r   r   r   r     sz    +


























		r   N)rH   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r-   r;   r   r   r   r   r   Ú<module>   s    (>