o
    eR7                     @   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
 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)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd Z fddZejejddfddZejejddfddZejejejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )BindingListc                    s2   t t| | d|i| _djdi | j| _dS )a/  
        Initialize the BindingList

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

        :returns: twilio.rest.ip_messaging.v2.service.binding.BindingList
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingList
        service_sidz /Services/{service_sid}/BindingsN )superr	   __init__	_solutionformat_uri)selfversionr
   	__class__r   ^/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/ip_messaging/v2/service/binding.pyr      s   

zBindingList.__init__Nc                 C   s4   | j ||}| j|||d d}| j ||d S )aK  
        Streams BindingInstance 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 list[BindingInstance.BindingType] binding_type: The binding_type
        :param list[unicode] identity: The identity
        :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.ip_messaging.v2.service.binding.BindingInstance]
        	page_size)binding_typeidentityr   limit)_versionread_limitspagestream)r   r   r   r   r   limitsr   r   r   r   r   $   s   zBindingList.streamc                 C   s   t | j||||dS )a  
        Lists BindingInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param list[BindingInstance.BindingType] binding_type: The binding_type
        :param list[unicode] identity: The identity
        :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.ip_messaging.v2.service.binding.BindingInstance]
        )r   r   r   r   )listr   )r   r   r   r   r   r   r   r   r   >   s   zBindingList.listc                 C   sR   t t|dd t|dd |||d}| jjd| j|d}t| j|| jS )aK  
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param list[BindingInstance.BindingType] binding_type: The binding_type
        :param list[unicode] identity: The identity
        :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 BindingInstance
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingPage
        c                 S      | S Nr   er   r   r   <lambda>i       z"BindingList.page.<locals>.<lambda>c                 S   r    r!   r   r"   r   r   r   r$   j   r%   )BindingTypeIdentity	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   mapr   r   r   BindingPager   )r   r   r   
page_tokenpage_numberr   dataresponser   r   r   r   X   s   zBindingList.pagec                 C   s"   | j jjd|}t| j || jS )a?  
        Retrieve a specific page of BindingInstance records from the API.
        Request is executed immediately

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

        :returns: Page of BindingInstance
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingPage
        r*   )r   domaintwiliorequestr0   r   )r   
target_urlr4   r   r   r   get_paget   s
   

zBindingList.get_pagec                 C      t | j| jd |dS z
        Constructs a BindingContext

        :param sid: The sid

        :returns: twilio.rest.ip_messaging.v2.service.binding.BindingContext
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingContext
        r
   r
   sidBindingContextr   r   r   r=   r   r   r   get      	zBindingList.getc                 C   r:   r;   r>   r@   r   r   r   __call__   rB   zBindingList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.IpMessaging.V2.BindingList>r   r   r   r   r   __repr__      zBindingList.__repr__)__name__
__module____qualname__r   r   unsetr   r   r   r9   rA   rC   rG   __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 )r0   c                    s   t t| || || _dS )ag  
        Initialize the BindingPage

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

        :returns: twilio.rest.ip_messaging.v2.service.binding.BindingPage
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingPage
        N)r   r0   r   r   )r   r   r4   solutionr   r   r   r      s   
zBindingPage.__init__c                 C   s   t | j|| jd dS )a  
        Build an instance of BindingInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.ip_messaging.v2.service.binding.BindingInstance
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingInstance
        r
   )r
   )BindingInstancer   r   r   payloadr   r   r   get_instance   rB   zBindingPage.get_instancec                 C   rD   )rE   z#<Twilio.IpMessaging.V2.BindingPage>r   rF   r   r   r   rG      rH   zBindingPage.__repr__)rI   rJ   rK   r   rR   rG   rM   r   r   r   r   r0      s    r0   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 )aT  
        Initialize the BindingContext

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

        :returns: twilio.rest.ip_messaging.v2.service.binding.BindingContext
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingContext
        r<   z&/Services/{service_sid}/Bindings/{sid}Nr   )r   r?   r   r   r   r   )r   r   r
   r=   r   r   r   r      s   zBindingContext.__init__c                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the BindingInstance

        :returns: The fetched BindingInstance
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingInstance
        r*   r+   r,   r
   r=   r<   )r   fetchr   rO   r   rP   r   r   r   rU      s   zBindingContext.fetchc                 C   s   | j jd| jdS )~
        Deletes the BindingInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErT   )r   deleter   rF   r   r   r   rX      s   zBindingContext.deletec                 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*BindingContext.__repr__.<locals>.<genexpr>z)<Twilio.IpMessaging.V2.BindingContext {}>joinr   itemsr   r   contextr   r   r   rG         
zBindingContext.__repr__)rI   rJ   rK   r   rU   rX   rG   rM   r   r   r   r   r?      s
    	r?   c                       s   e Zd ZG dd de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d$d% Z  ZS )'rO   c                   @   s   e Zd ZdZdZdZdS )zBindingInstance.BindingTypegcmapnfcmN)rI   rJ   rK   GCMAPNFCMr   r   r   r   r&     s    r&   Nc                    s   t t| | |d|d|dt|dt|d|d|d|d|d	|d
|d|dd| _d| _||pL| jd d| _dS )z
        Initialize the BindingInstance

        :returns: twilio.rest.ip_messaging.v2.service.binding.BindingInstance
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingInstance
        r=   account_sidr
   date_createddate_updatedendpointr   credential_sidr   message_typesurllinks)r=   rp   r
   rq   rr   rs   r   rt   r   ru   rv   rw   Nr<   )	r   rO   r   rA   r   iso8601_datetime_properties_contextr   )r   r   rQ   r
   r=   r   r   r   r   
  s    zBindingInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )a5  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: BindingContext for this BindingInstance
        :rtype: twilio.rest.ip_messaging.v2.service.binding.BindingContext
        Nr
   r=   r<   )rz   r?   r   r   rF   r   r   r   _proxy'  s   
	zBindingInstance._proxyc                 C   
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        r=   ry   rF   r   r   r   r=   8     
zBindingInstance.sidc                 C   r|   )zC
        :returns: The account_sid
        :rtype: unicode
        rp   r}   rF   r   r   r   rp   @  r~   zBindingInstance.account_sidc                 C   r|   )zC
        :returns: The service_sid
        :rtype: unicode
        r
   r}   rF   r   r   r   r
   H  r~   zBindingInstance.service_sidc                 C   r|   )zE
        :returns: The date_created
        :rtype: datetime
        rq   r}   rF   r   r   r   rq   P  r~   zBindingInstance.date_createdc                 C   r|   )zE
        :returns: The date_updated
        :rtype: datetime
        rr   r}   rF   r   r   r   rr   X  r~   zBindingInstance.date_updatedc                 C   r|   )z@
        :returns: The endpoint
        :rtype: unicode
        rs   r}   rF   r   r   r   rs   `  r~   zBindingInstance.endpointc                 C   r|   )z@
        :returns: The identity
        :rtype: unicode
        r   r}   rF   r   r   r   r   h  r~   zBindingInstance.identityc                 C   r|   )zF
        :returns: The credential_sid
        :rtype: unicode
        rt   r}   rF   r   r   r   rt   p  r~   zBindingInstance.credential_sidc                 C   r|   )zX
        :returns: The binding_type
        :rtype: BindingInstance.BindingType
        r   r}   rF   r   r   r   r   x  r~   zBindingInstance.binding_typec                 C   r|   )zK
        :returns: The message_types
        :rtype: list[unicode]
        ru   r}   rF   r   r   r   ru     r~   zBindingInstance.message_typesc                 C   r|   )z;
        :returns: The url
        :rtype: unicode
        rv   r}   rF   r   r   r   rv     r~   zBindingInstance.urlc                 C   r|   )z=
        :returns: The links
        :rtype: unicode
        rw   r}   rF   r   r   r   rw     r~   zBindingInstance.linksc                 C   
   | j  S )rS   )r{   rU   rF   r   r   r   rU        
zBindingInstance.fetchc                 C   r   )rV   )r{   rX   rF   r   r   r   rX     r   zBindingInstance.deletec                 C   rY   )rE   rZ   c                 s   r[   r\   r]   r^   r   r   r   rb     rc   z+BindingInstance.__repr__.<locals>.<genexpr>z*<Twilio.IpMessaging.V2.BindingInstance {}>rd   rg   r   r   r   rG     ri   zBindingInstance.__repr__r!   )rI   rJ   rK   objectr&   r   propertyr{   r=   rp   r
   rq   rr   rs   r   rt   r   ru   rv   rw   rU   rX   rG   rM   r   r   r   r   rO     s@    












		rO   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r0   r?   rO   r   r   r   r   <module>   s    '7