o
    ä›eI  ã                   @   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                       sn   e 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 )ÚPhoneNumberListc                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )ac  
        Initialize the PhoneNumberList

        :param Version version: Version that contains the resource
        :param trunk_sid: The SID of the Trunk that handles calls to the phone number

        :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/venv/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 )a+  
        Create the PhoneNumberInstance

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

        :returns: The created PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        ÚPhoneNumberSidÚPOST)ÚmethodÚuriÚdatar	   ©r	   )r   ÚofÚ_versionÚcreater   ÚPhoneNumberInstancer   )r   Úphone_number_sidr   Úpayloadr
   r
   r   r   #   s   	zPhoneNumberList.createNc                 C   s0   | j  ||¡}| j|d d}| j  ||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)r   Úread_limitsÚpageÚstream)r   r"   r!   Úlimitsr$   r
   r
   r   r%   2   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'   I   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)r   r   Ú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_urlr/   r
   r
   r   Úget_pagen   s
   

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

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        r	   ©r	   Úsid©ÚPhoneNumberContextr   r   ©r   r8   r
   r
   r   Úget   ó   	zPhoneNumberList.getc                 C   r5   r6   r9   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__r   r   r%   r'   r   Úunsetr$   r4   r<   r>   rB   Ú__classcell__r
   r
   r   r   r      s    


ÿr   c                       s,   e Zd Z‡ fdd„Zdd„ Zdd„ Z‡  ZS )r,   c                    s   t t| ƒ ||¡ || _dS )a›  
        Initialize the PhoneNumberPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param trunk_sid: The SID of the Trunk that handles calls to the phone number

        :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   r/   Ú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?   )r@   z$<Twilio.Trunking.V1.PhoneNumberPage>r
   rA   r
   r
   r   rB   ¼   rC   zPhoneNumberPage.__repr__)rD   rE   rF   r   rK   rB   rH   r
   r
   r   r   r,   Ÿ   s    r,   c                       s4   e Zd Z‡ fdd„Zdd„ Zdd„ Zdd„ Z‡  ZS )	r:   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )aµ  
        Initialize the PhoneNumberContext

        :param Version 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 identifies the resource

        :returns: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberContext
        r7   z&/Trunks/{trunk_sid}/PhoneNumbers/{sid}Nr
   )r   r:   r   r   r   r   )r   r   r	   r8   r   r
   r   r   È   s   zPhoneNumberContext.__init__c                 C   s0   | j jd| jd}t| j || jd | jd dS )ú±
        Fetch the PhoneNumberInstance

        :returns: The fetched PhoneNumberInstance
        :rtype: twilio.rest.trunking.v1.trunk.phone_number.PhoneNumberInstance
        r*   ©r   r   r	   r8   r7   )r   Úfetchr   r   r   rJ   r
   r
   r   rN   Ù   s   üzPhoneNumberContext.fetchc                 C   s   | j jd| jdS )ú‚
        Deletes the PhoneNumberInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        ÚDELETErM   )r   Údeleter   rA   r
   r
   r   rQ   é   s   zPhoneNumberContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )r@   ú 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   rB   ò   ó   
zPhoneNumberContext.__repr__)rD   rE   rF   r   rN   rQ   rB   rH   r
   r
   r   r   r:   Æ   s
    	r:   c                       sŠ  e Zd ZG dd„ deƒZdB‡ 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.d/„ ƒZed0d1„ ƒZed2d3„ ƒZed4d5„ ƒZed6d7„ ƒZed8d9„ ƒZ ed:d;„ ƒZ!d<d=„ Z"d>d?„ Z#d@dA„ Z$‡  Z%S )Cr   c                   @   s   e Zd ZdZdZdZdZdS )z&PhoneNumberInstance.AddressRequirementÚnoneÚanyÚlocalÚforeignN)rD   rE   rF   ÚNONEÚANYÚLOCALÚFOREIGNr
   r
   r
   r   ÚAddressRequirementÿ   s
    rk   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_numberr8   Ú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ƒ   Nr7   )	r   r   r   r<   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r    r	   r8   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	   r8   r7   )r†   r:   r   r   rA   r
   r
   r   Ú_proxy0  s   
	ýzPhoneNumberInstance._proxyc                 C   ó
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rl   ©r…   rA   r
   r
   r   rl   A  ó   
zPhoneNumberInstance.account_sidc                 C   rˆ   )z–
        :returns: Whether the phone number requires an Address registered with Twilio
        :rtype: PhoneNumberInstance.AddressRequirement
        rm   r‰   rA   r
   r
   r   rm   I  rŠ   z(PhoneNumberInstance.address_requirementsc                 C   rˆ   )ze
        :returns: The API version used to start a new TwiML session
        :rtype: unicode
        rn   r‰   rA   r
   r
   r   rn   Q  rŠ   zPhoneNumberInstance.api_versionc                 C   rˆ   )zg
        :returns: Whether the phone number is new to the Twilio platform
        :rtype: bool
        ro   r‰   rA   r
   r
   r   ro   Y  rŠ   zPhoneNumberInstance.betac                 C   rˆ   )zb
        :returns: Indicate if a phone can receive calls or messages
        :rtype: dict
        rp   r‰   rA   r
   r
   r   rp   a  rŠ   z PhoneNumberInstance.capabilitiesc                 C   rˆ   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rq   r‰   rA   r
   r
   r   rq   i  rŠ   z PhoneNumberInstance.date_createdc                 C   rˆ   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rr   r‰   rA   r
   r
   r   rr   q  rŠ   z PhoneNumberInstance.date_updatedc                 C   rˆ   )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        rs   r‰   rA   r
   r
   r   rs   y  rŠ   z!PhoneNumberInstance.friendly_namec                 C   rˆ   )zQ
        :returns: The URLs of related resources
        :rtype: unicode
        rt   r‰   rA   r
   r
   r   rt     rŠ   zPhoneNumberInstance.linksc                 C   rˆ   )zT
        :returns: The phone number in E.164 format
        :rtype: unicode
        ru   r‰   rA   r
   r
   r   ru   ‰  rŠ   z PhoneNumberInstance.phone_numberc                 C   rˆ   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r8   r‰   rA   r
   r
   r   r8   ‘  rŠ   zPhoneNumberInstance.sidc                 C   rˆ   )z
        :returns: The SID of the application that handles SMS messages sent to the phone number
        :rtype: unicode
        rv   r‰   rA   r
   r
   r   rv   ™  rŠ   z'PhoneNumberInstance.sms_application_sidc                 C   rˆ   )z^
        :returns: The HTTP method used with sms_fallback_url
        :rtype: unicode
        rw   r‰   rA   r
   r
   r   rw   ¡  rŠ   z'PhoneNumberInstance.sms_fallback_methodc                 C   rˆ   )z…
        :returns: The URL that we call when an error occurs while retrieving or executing the TwiML
        :rtype: unicode
        rx   r‰   rA   r
   r
   r   rx   ©  rŠ   z$PhoneNumberInstance.sms_fallback_urlc                 C   rˆ   )zW
        :returns: The HTTP method to use with sms_url
        :rtype: unicode
        ry   r‰   rA   r
   r
   r   ry   ±  rŠ   zPhoneNumberInstance.sms_methodc                 C   rˆ   )zz
        :returns: The URL we call when the phone number receives an incoming SMS message
        :rtype: unicode
        rz   r‰   rA   r
   r
   r   rz   ¹  rŠ   zPhoneNumberInstance.sms_urlc                 C   rˆ   )zj
        :returns: The URL to send status information to your application
        :rtype: unicode
        r{   r‰   rA   r
   r
   r   r{   Á  rŠ   z#PhoneNumberInstance.status_callbackc                 C   rˆ   )zb
        :returns: The HTTP method we use to call status_callback
        :rtype: unicode
        r|   r‰   rA   r
   r
   r   r|   É  rŠ   z*PhoneNumberInstance.status_callback_methodc                 C   rˆ   )zo
        :returns: The SID of the Trunk that handles calls to the phone number
        :rtype: unicode
        r	   r‰   rA   r
   r
   r   r	   Ñ  rŠ   zPhoneNumberInstance.trunk_sidc                 C   rˆ   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r}   r‰   rA   r
   r
   r   r}   Ù  rŠ   zPhoneNumberInstance.urlc                 C   rˆ   )zu
        :returns: The SID of the application that handles calls to the phone number
        :rtype: unicode
        r~   r‰   rA   r
   r
   r   r~   á  rŠ   z)PhoneNumberInstance.voice_application_sidc                 C   rˆ   )zT
        :returns: Whether to lookup the caller's name
        :rtype: bool
        r   r‰   rA   r
   r
   r   r   é  rŠ   z*PhoneNumberInstance.voice_caller_id_lookupc                 C   rˆ   )zj
        :returns: The HTTP method that we use to call voice_fallback_url
        :rtype: unicode
        r€   r‰   rA   r
   r
   r   r€   ñ  rŠ   z)PhoneNumberInstance.voice_fallback_methodc                 C   rˆ   )za
        :returns: The URL we call when an error occurs in TwiML
        :rtype: unicode
        r   r‰   rA   r
   r
   r   r   ù  rŠ   z&PhoneNumberInstance.voice_fallback_urlc                 C   rˆ   )z[
        :returns: The HTTP method used with the voice_url
        :rtype: unicode
        r‚   r‰   rA   r
   r
   r   r‚     rŠ   z PhoneNumberInstance.voice_methodc                 C   rˆ   )zi
        :returns: The URL we call when the phone number receives a call
        :rtype: unicode
        rƒ   r‰   rA   r
   r
   r   rƒ   	  rŠ   zPhoneNumberInstance.voice_urlc                 C   ó
   | j  ¡ S )rL   )r‡   rN   rA   r
   r
   r   rN     ó   
zPhoneNumberInstance.fetchc                 C   r‹   )rO   )r‡   rQ   rA   r
   r
   r   rQ     rŒ   zPhoneNumberInstance.deletec                 C   rR   )r@   rS   c                 s   rT   rU   rV   rW   r
   r
   r   r[   *  r\   z/PhoneNumberInstance.__repr__.<locals>.<genexpr>z+<Twilio.Trunking.V1.PhoneNumberInstance {}>r]   r`   r
   r
   r   rB   #  rb   zPhoneNumberInstance.__repr__)N)&rD   rE   rF   Úobjectrk   r   Úpropertyr‡   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   r8   rv   rw   rx   ry   rz   r{   r|   r	   r}   r~   r   r€   r   r‚   rƒ   rN   rQ   rB   rH   r
   r
   r   r   r   ý   sx    +


























		r   N)Ú__doc__Ú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    '7