o
    �¨Êhˆ8  ã                   @   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úÉ PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a>  
        Initialize the PhoneNumberList

        :param Version version: Version that contains the resource
        :param service_sid: Service Sid.

        :returns: twilio.rest.preview.proxy.service.phone_number.PhoneNumberList
        :rtype: twilio.rest.preview.proxy.service.phone_number.PhoneNumberList
        Úservice_sidz$/Services/{service_sid}/PhoneNumbersN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr
   ©Ú	__class__r   ú`/var/www/html/env/lib/python3.10/site-packages/twilio/rest/preview/proxy/service/phone_number.pyr      s   

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

        :param unicode sid: Delete by unique phone-number Sid

        :returns: Newly created PhoneNumberInstance
        :rtype: twilio.rest.preview.proxy.service.phone_number.PhoneNumberInstance
        ÚSidÚPOST)Údatar
   ©r
   )r   ÚofÚ_versionÚcreater   ÚPhoneNumberInstancer   )r   Ú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.preview.proxy.service.phone_number.PhoneNumberInstance]
        Ú	page_size)r    ÚlimitÚ
page_limit)r   Úread_limitsÚpageÚstream)r   r!   r    Úlimitsr$   r   r   r   r%   9   s   zPhoneNumberList.streamc                 C   s   t | j||d�ƒS )ar  
        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.preview.proxy.service.phone_number.PhoneNumberInstance]
        )r!   r    )Úlistr%   )r   r!   r    r   r   r   r'   P   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.preview.proxy.service.phone_number.PhoneNumberPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   r   r   r$   r   ÚPhoneNumberPager   )r   Ú
page_tokenÚpage_numberr    r,   Úresponser   r   r   r$   b   s   ýzPhoneNumberList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )aN  
        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.preview.proxy.service.phone_number.PhoneNumberPage
        r*   )r   ÚdomainÚtwilioÚrequestr-   r   )r   Ú
target_urlr0   r   r   r   Úget_pagey   s
   

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

        :param sid: Fetch by unique phone-number Sid

        :returns: twilio.rest.preview.proxy.service.phone_number.PhoneNumberContext
        :rtype: twilio.rest.preview.proxy.service.phone_number.PhoneNumberContext
        r
   ©r
   r   ©ÚPhoneNumberContextr   r   ©r   r   r   r   r   ÚgetŠ   ó   	zPhoneNumberList.getc                 C   r6   r7   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.Preview.Proxy.PhoneNumberList>r   ©r   r   r   r   Ú__repr__    ó   zPhoneNumberList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r%   r'   r   Úunsetr$   r5   r<   r>   rB   Ú__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 )av  
        Initialize the PhoneNumberPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: Service Sid.

        :returns: twilio.rest.preview.proxy.service.phone_number.PhoneNumberPage
        :rtype: twilio.rest.preview.proxy.service.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.preview.proxy.service.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.preview.proxy.service.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.Preview.Proxy.PhoneNumberPage>r   rA   r   r   r   rB   Ê   rC   zPhoneNumberPage.__repr__)rD   rE   rF   rG   r   rK   rB   rI   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 )a  
        Initialize the PhoneNumberContext

        :param Version version: Version that contains the resource
        :param service_sid: The service_sid
        :param sid: Fetch by unique phone-number Sid

        :returns: twilio.rest.preview.proxy.service.phone_number.PhoneNumberContext
        :rtype: twilio.rest.preview.proxy.service.phone_number.PhoneNumberContext
        r8   z*/Services/{service_sid}/PhoneNumbers/{sid}Nr   )r   r:   r   r   r   r   )r   r   r
   r   r   r   r   r   Ù   s   zPhoneNumberContext.__init__c                 C   s   | j  d| j¡S )ú‚
        Deletes the PhoneNumberInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rM   r   rA   r   r   r   rM   ê   s   zPhoneNumberContext.deletec                 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.preview.proxy.service.phone_number.PhoneNumberInstance
        r*   r+   r
   r   r8   )r   r   r   Úfetchr   r   r   )r   r,   r   r   r   r   rO   ó   s   
ýüzPhoneNumberContext.fetchc                 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.Preview.Proxy.PhoneNumberContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rB   	  ó   
zPhoneNumberContext.__repr__)	rD   rE   rF   rG   r   rM   rO   rB   rI   r   r   r   r   r:   Ô   s    	r:   c                       s²   e Zd ZdZd‡ 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dd„ Zdd„ Zdd„ Z‡  ZS ) r   r	   Nc              
      sz   t t| ƒ |¡ |d |d |d t |d ¡t |d ¡|d |d |d |d	 d
œ	| _d| _||p7| jd dœ| _dS )zÝ
        Initialize the PhoneNumberInstance

        :returns: twilio.rest.preview.proxy.service.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.preview.proxy.service.phone_number.PhoneNumberInstance
        r   Úaccount_sidr
   Údate_createdÚdate_updatedÚphone_numberÚcountry_codeÚcapabilitiesÚurl)	r   ra   r
   rb   rc   rd   re   rf   rg   Nr8   )r   r   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r   r
   r   r   r   r   r     s   ÷zPhoneNumberInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )aD  
        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.preview.proxy.service.phone_number.PhoneNumberContext
        Nr
   r   r8   )rj   r:   r   r   rA   r   r   r   Ú_proxy3  s   
	ýzPhoneNumberInstance._proxyc                 C   ó
   | j d S )zc
        :returns: A string that uniquely identifies this resource
        :rtype: unicode
        r   ©ri   rA   r   r   r   r   D  ó   
zPhoneNumberInstance.sidc                 C   rl   )z@
        :returns: Account Sid.
        :rtype: unicode
        ra   rm   rA   r   r   r   ra   L  rn   zPhoneNumberInstance.account_sidc                 C   rl   )z@
        :returns: Service Sid.
        :rtype: unicode
        r
   rm   rA   r   r   r   r
   T  rn   zPhoneNumberInstance.service_sidc                 C   rl   )zW
        :returns: The date this resource was created
        :rtype: datetime
        rb   rm   rA   r   r   r   rb   \  rn   z PhoneNumberInstance.date_createdc                 C   rl   )z\
        :returns: The date this resource was last updated
        :rtype: datetime
        rc   rm   rA   r   r   r   rc   d  rn   z PhoneNumberInstance.date_updatedc                 C   rl   )zD
        :returns: The phone number
        :rtype: unicode
        rd   rm   rA   r   r   r   rd   l  rn   z PhoneNumberInstance.phone_numberc                 C   rl   )zW
        :returns: The ISO 3166-1 alpha-2 country code
        :rtype: unicode
        re   rm   rA   r   r   r   re   t  rn   z PhoneNumberInstance.country_codec                 C   rl   )ze
        :returns: Indicate if a phone can receive calls or messages
        :rtype: unicode
        rf   rm   rA   r   r   r   rf   |  rn   z PhoneNumberInstance.capabilitiesc                 C   rl   )zM
        :returns: The URL of this resource.
        :rtype: unicode
        rg   rm   rA   r   r   r   rg   „  rn   zPhoneNumberInstance.urlc                 C   ó
   | j  ¡ S )rL   )rk   rM   rA   r   r   r   rM   Œ  ó   
zPhoneNumberInstance.deletec                 C   ro   )rN   )rk   rO   rA   r   r   r   rO   •  rp   zPhoneNumberInstance.fetchc                 C   rP   )r@   rQ   c                 s   rR   rS   rT   rU   r   r   r   rY   ¥  rZ   z/PhoneNumberInstance.__repr__.<locals>.<genexpr>z-<Twilio.Preview.Proxy.PhoneNumberInstance {}>r[   r^   r   r   r   rB   ž  r`   zPhoneNumberInstance.__repr__)N)rD   rE   rF   rG   r   Úpropertyrk   r   ra   r
   rb   rc   rd   re   rf   rg   rM   rO   rB   rI   r   r   r   r   r     s4    









		r   N)rG   Ú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    *@