o
    e4                     @   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 )SourceIpMappingListc                    s.   t t| | i | _djdi | j| _dS )a  
        Initialize the SourceIpMappingList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingList
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingList
        z/SourceIpMappingsN )superr   __init__	_solutionformat_uri)selfversion	__class__r	   Y/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/voice/v1/source_ip_mapping.pyr      s   	zSourceIpMappingList.__init__c                 C   s0   t ||d}| jjd| j|d}t| j|S )af  
        Create the SourceIpMappingInstance

        :param unicode ip_record_sid: The unique string that identifies an IP Record
        :param unicode sip_domain_sid: The unique string that identifies a SIP Domain

        :returns: The created SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        )IpRecordSidSipDomainSidPOSTmethoduridata)r   of_versioncreater   SourceIpMappingInstance)r   ip_record_sidsip_domain_sidr   payloadr	   r	   r   r   "   s   
zSourceIpMappingList.createNc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams SourceIpMappingInstance 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.voice.v1.source_ip_mapping.SourceIpMappingInstance]
        	page_size)r"   limit)r   read_limitspagestream)r   r#   r"   limitsr%   r	   r	   r   r&   2   s   zSourceIpMappingList.streamc                 C   s   t | j||dS )ar  
        Lists SourceIpMappingInstance 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.voice.v1.source_ip_mapping.SourceIpMappingInstance]
        )r#   r"   )listr&   )r   r#   r"   r	   r	   r   r(   I   s   zSourceIpMappingList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of SourceIpMappingInstance 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 SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingPage
        )	PageTokenr   PageSizeGET)r   r   params)r   r   r   r%   r   SourceIpMappingPager   )r   
page_tokenpage_numberr"   r   responser	   r	   r   r%   [   s   zSourceIpMappingList.pagec                 C   s"   | j jjd|}t| j || jS )aR  
        Retrieve a specific page of SourceIpMappingInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingPage
        r+   )r   domaintwiliorequestr-   r   )r   
target_urlr0   r	   r	   r   get_pagen   s
   

zSourceIpMappingList.get_pagec                 C      t | j|dS a  
        Constructs a SourceIpMappingContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingContext
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingContext
        sidSourceIpMappingContextr   r   r9   r	   r	   r   get      	zSourceIpMappingList.getc                 C   r6   r7   r:   r<   r	   r	   r   __call__   r>   zSourceIpMappingList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Voice.V1.SourceIpMappingList>r	   r   r	   r	   r   __repr__      zSourceIpMappingList.__repr__)NN)__name__
__module____qualname__r   r   r&   r(   r   unsetr%   r5   r=   r?   rC   __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 )aI  
        Initialize the SourceIpMappingPage

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

        :returns: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingPage
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingPage
        N)r
   r-   r   r   )r   r   r0   solutionr   r	   r   r      s   

zSourceIpMappingPage.__init__c                 C   s   t | j|S )a  
        Build an instance of SourceIpMappingInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        )r   r   r   r!   r	   r	   r   get_instance      	z SourceIpMappingPage.get_instancec                 C   r@   )rA   z%<Twilio.Voice.V1.SourceIpMappingPage>r	   rB   r	   r	   r   rC      rD   zSourceIpMappingPage.__repr__)rE   rF   rG   r   rL   rC   rI   r	   r	   r   r   r-      s    r-   c                       s<   e Zd Z fddZdd Zdd Zdd Zd	d
 Z  ZS )r;   c                    s2   t t| | d|i| _djdi | j| _dS )a]  
        Initialize the SourceIpMappingContext

        :param Version version: Version that contains the resource
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingContext
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingContext
        r9   z/SourceIpMappings/{sid}Nr	   )r
   r;   r   r   r   r   )r   r   r9   r   r	   r   r      s   

zSourceIpMappingContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the SourceIpMappingInstance

        :returns: The fetched SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        r+   r   r   r9   r8   )r   fetchr   r   r   rK   r	   r	   r   rP      s   zSourceIpMappingContext.fetchc                 C   s8   t d|i}| jjd| j|d}t| j|| jd dS )  
        Update the SourceIpMappingInstance

        :param unicode sip_domain_sid: The unique string that identifies a SIP Domain

        :returns: The updated SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        r   r   r   r9   r8   )r   r   r   updater   r   r   )r   r    r   r!   r	   r	   r   rR      s   	zSourceIpMappingContext.updatec                 C   s   | j jd| jdS )
        Deletes the SourceIpMappingInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErO   )r   deleter   rB   r	   r	   r   rU      s   zSourceIpMappingContext.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>      z2SourceIpMappingContext.__repr__.<locals>.<genexpr>z+<Twilio.Voice.V1.SourceIpMappingContext {}>joinr   itemsr   r   contextr	   r	   r   rC         
zSourceIpMappingContext.__repr__)	rE   rF   rG   r   rP   rR   rU   rC   rI   r	   r	   r   r   r;      s    	r;   c                       s   e 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dd Zdd Zdd Zdd Z  ZS )r   Nc              	      sr   t t| | |d|d|dt|dt|d|dd| _d| _d|p4| jd i| _dS )	z
        Initialize the SourceIpMappingInstance

        :returns: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingInstance
        r9   r   r    date_createddate_updatedurl)r9   r   r    rg   rh   ri   N)	r
   r   r   r=   r   iso8601_datetime_properties_contextr   )r   r   r!   r9   r   r	   r   r     s   
z SourceIpMappingInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )aH  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: SourceIpMappingContext for this SourceIpMappingInstance
        :rtype: twilio.rest.voice.v1.source_ip_mapping.SourceIpMappingContext
        Nr9   r8   )rl   r;   r   r   rB   r	   r	   r   _proxy  s   
	zSourceIpMappingInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r9   rk   rB   r	   r	   r   r9   +     
zSourceIpMappingInstance.sidc                 C   rn   )zb
        :returns: The unique string that identifies an IP Record
        :rtype: unicode
        r   ro   rB   r	   r	   r   r   3  rp   z%SourceIpMappingInstance.ip_record_sidc                 C   rn   )zb
        :returns: The unique string that identifies a SIP Domain
        :rtype: unicode
        r    ro   rB   r	   r	   r   r    ;  rp   z&SourceIpMappingInstance.sip_domain_sidc                 C   rn   )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        rg   ro   rB   r	   r	   r   rg   C  rp   z$SourceIpMappingInstance.date_createdc                 C   rn   )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rh   ro   rB   r	   r	   r   rh   K  rp   z$SourceIpMappingInstance.date_updatedc                 C   rn   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        ri   ro   rB   r	   r	   r   ri   S  rp   zSourceIpMappingInstance.urlc                 C   
   | j  S )rN   )rm   rP   rB   r	   r	   r   rP   [     
zSourceIpMappingInstance.fetchc                 C   s   | j |S )rQ   )rm   rR   )r   r    r	   r	   r   rR   d  rM   zSourceIpMappingInstance.updatec                 C   rq   )rS   )rm   rU   rB   r	   r	   r   rU   o  rr   zSourceIpMappingInstance.deletec                 C   rV   )rA   rW   c                 s   rX   rY   rZ   r[   r	   r	   r   r_     r`   z3SourceIpMappingInstance.__repr__.<locals>.<genexpr>z,<Twilio.Voice.V1.SourceIpMappingInstance {}>ra   rd   r	   r	   r   rC   x  rf   z SourceIpMappingInstance.__repr__)N)rE   rF   rG   r   propertyrm   r9   r   r    rg   rh   ri   rP   rR   rU   rC   rI   r	   r	   r   r   r     s(    






		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    &@