o
    e?                     @   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                       s   e Zd ZdZ fddZejejejf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 )PhoneNumberListk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                    s2   t t| | d|i| _djdi | j| _dS )ae  
        Initialize the PhoneNumberList

        :param Version version: Version that contains the resource
        :param service_sid: The SID of the PhoneNumber resource's parent Service resource

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

zPhoneNumberList.__init__c                 C   s<   t |||d}| jjd| j|d}t| j|| jd dS )a  
        Create the PhoneNumberInstance

        :param unicode sid: The SID of a Twilio IncomingPhoneNumber resource
        :param unicode phone_number: The phone number in E.164 format
        :param bool is_reserved: Whether the new phone number should be reserved

        :returns: The created PhoneNumberInstance
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberInstance
        )SidPhoneNumber
IsReservedPOSTmethoduridatar
   r
   )r   of_versioncreater   PhoneNumberInstancer   )r   sidphone_numberis_reservedr   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.proxy.v1.service.phone_number.PhoneNumberInstance]
        	page_size)r'   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 )am  
        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.proxy.v1.service.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.proxy.v1.service.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 )aI  
        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.proxy.v1.service.phone_number.PhoneNumberPage
        r0   )r    domaintwiliorequestr2   r   )r   
target_urlr5   r   r   r   get_pages   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.proxy.v1.service.phone_number.PhoneNumberContext
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberContext
        r
   r
   r#   PhoneNumberContextr    r   r   r#   r   r   r   get      	zPhoneNumberList.getc                 C   r;   r<   r>   r@   r   r   r   __call__   rB   zPhoneNumberList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z!<Twilio.Proxy.V1.PhoneNumberList>r   r   r   r   r   __repr__      zPhoneNumberList.__repr__)NN)__name__
__module____qualname____doc__r   r   unsetr!   r+   r-   r*   r:   rA   rC   rG   __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 )r2   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 service_sid: The SID of the PhoneNumber resource's parent Service resource

        :returns: twilio.rest.proxy.v1.service.phone_number.PhoneNumberPage
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberPage
        N)r   r2   r   r   )r   r   r5   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.proxy.v1.service.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberInstance
        r
   r   )r"   r    r   r   r&   r   r   r   get_instance   rB   zPhoneNumberPage.get_instancec                 C   rD   )rE   z!<Twilio.Proxy.V1.PhoneNumberPage>r   rF   r   r   r   rG      rH   zPhoneNumberPage.__repr__)rI   rJ   rK   rL   r   rQ   rG   rN   r   r   r   r   r2      s
    r2   c                       sF   e Zd ZdZ fddZdd Zdd Zejf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 SID of the parent Service resource of the PhoneNumber resource to fetch
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.proxy.v1.service.phone_number.PhoneNumberContext
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberContext
        r=   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 jd| jdS )
        Deletes the PhoneNumberInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr   r   )r    deleter   rF   r   r   r   rU      s   zPhoneNumberContext.deletec                 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.proxy.v1.service.phone_number.PhoneNumberInstance
        r0   rT   r
   r#   r=   )r    fetchr   r"   r   rP   r   r   r   rW      s   zPhoneNumberContext.fetchc                 C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )  
        Update the PhoneNumberInstance

        :param bool is_reserved: Whether the new phone number should be reserved

        :returns: The updated PhoneNumberInstance
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberInstance
        r   r   r   r
   r#   r=   )r   r   r    updater   r"   r   )r   r%   r   r&   r   r   r   rY      s   	zPhoneNumberContext.updatec                 C   $   d dd | j D }d|S )rE    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>      z.PhoneNumberContext.__repr__.<locals>.<genexpr>z'<Twilio.Proxy.V1.PhoneNumberContext {}>joinr   itemsr   r   contextr   r   r   rG        
zPhoneNumberContext.__repr__)rI   rJ   rK   rL   r   rU   rW   r   rM   rY   rG   rN   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edd Zedd Zedd Zdd  Zd!d" Zejfd#d$Zd%d& Z  ZS )(r"   r	   Nc                    s   t t| | |d|d|dt|dt|d|d|d|d|d	|d
|dt|dd| _d| _||pO| jd d| _	dS )z
        Initialize the PhoneNumberInstance

        :returns: twilio.rest.proxy.v1.service.phone_number.PhoneNumberInstance
        :rtype: twilio.rest.proxy.v1.service.phone_number.PhoneNumberInstance
        r#   account_sidr
   date_createddate_updatedr$   friendly_nameiso_countrycapabilitiesurlr%   in_use)r#   rk   r
   rl   rm   r$   rn   ro   rp   rq   r%   rr   Nr=   )
r   r"   r   rA   r   iso8601_datetimeinteger_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 )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.proxy.v1.service.phone_number.PhoneNumberContext
        Nr
   r#   r=   )rv   r?   r    r   rF   r   r   r   _proxy;  s   
	zPhoneNumberInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r#   ru   rF   r   r   r   r#   L     
zPhoneNumberInstance.sidc                 C   rx   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rk   ry   rF   r   r   r   rk   T  rz   zPhoneNumberInstance.account_sidc                 C   rx   )zq
        :returns: The SID of the PhoneNumber resource's parent Service resource
        :rtype: unicode
        r
   ry   rF   r   r   r   r
   \  rz   zPhoneNumberInstance.service_sidc                 C   rx   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        rl   ry   rF   r   r   r   rl   d  rz   z PhoneNumberInstance.date_createdc                 C   rx   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rm   ry   rF   r   r   r   rm   l  rz   z PhoneNumberInstance.date_updatedc                 C   rx   )zT
        :returns: The phone number in E.164 format
        :rtype: unicode
        r$   ry   rF   r   r   r   r$   t  rz   z PhoneNumberInstance.phone_numberc                 C   rx   )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        rn   ry   rF   r   r   r   rn   |  rz   z!PhoneNumberInstance.friendly_namec                 C   rx   )zH
        :returns: The ISO Country Code
        :rtype: unicode
        ro   ry   rF   r   r   r   ro     rz   zPhoneNumberInstance.iso_countryc                 C   rx   )zX
        :returns: The capabilities of the phone number
        :rtype: unicode
        rp   ry   rF   r   r   r   rp     rz   z PhoneNumberInstance.capabilitiesc                 C   rx   )z`
        :returns: The absolute URL of the PhoneNumber resource
        :rtype: unicode
        rq   ry   rF   r   r   r   rq     rz   zPhoneNumberInstance.urlc                 C   rx   )zt
        :returns: Reserve the phone number for manual assignment to participants only
        :rtype: bool
        r%   ry   rF   r   r   r   r%     rz   zPhoneNumberInstance.is_reservedc                 C   rx   )zf
        :returns: The number of open session assigned to the number.
        :rtype: unicode
        rr   ry   rF   r   r   r   rr     rz   zPhoneNumberInstance.in_usec                 C   
   | j  S )rR   )rw   rU   rF   r   r   r   rU        
zPhoneNumberInstance.deletec                 C   r{   )rV   )rw   rW   rF   r   r   r   rW     r|   zPhoneNumberInstance.fetchc                 C   s   | j j|dS )rX   )r%   )rw   rY   )r   r%   r   r   r   rY     s   	zPhoneNumberInstance.updatec                 C   rZ   )rE   r[   c                 s   r\   r]   r^   r_   r   r   r   rc     rd   z/PhoneNumberInstance.__repr__.<locals>.<genexpr>z(<Twilio.Proxy.V1.PhoneNumberInstance {}>re   rh   r   r   r   rG     rj   zPhoneNumberInstance.__repr__)N)rI   rJ   rK   rL   r   propertyrw   r#   rk   r
   rl   rm   r$   rn   ro   rp   rq   r%   rr   rU   rW   r   rM   rY   rG   rN   r   r   r   r   r"     sB    












		r"   N)rL   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r2   r?   r"   r   r   r   r   <module>   s    )M