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
 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 )ap  
        Initialize the BindingList

        :param Version version: Version that contains the resource
        :param chat_service_sid: The SID of the Conversation Service that the resource is associated with.

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

zBindingList.__init__Nc                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        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 push technology used by the Binding resources to read.
        :param list[unicode] identity: The identity of Conversation User associated with this binding.
        :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.conversations.v1.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 )aI  
        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 push technology used by the Binding resources to read.
        :param list[unicode] identity: The identity of Conversation User associated with this binding.
        :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.conversations.v1.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 )a  
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param list[BindingInstance.BindingType] binding_type: The push technology used by the Binding resources to read.
        :param list[unicode] identity: The identity of Conversation User associated with this binding.
        :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.conversations.v1.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.conversations.v1.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 a  
        Constructs a BindingContext

        :param sid: A 34 character string that uniquely identifies this resource.

        :returns: twilio.rest.conversations.v1.service.binding.BindingContext
        :rtype: twilio.rest.conversations.v1.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.Conversations.V1.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 )a  
        Initialize the BindingPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param chat_service_sid: The SID of the Conversation Service that the resource is associated with.

        :returns: twilio.rest.conversations.v1.service.binding.BindingPage
        :rtype: twilio.rest.conversations.v1.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.conversations.v1.service.binding.BindingInstance
        :rtype: twilio.rest.conversations.v1.service.binding.BindingInstance
        r
   )r
   )BindingInstancer   r   r   payloadr   r   r   get_instance   rB   zBindingPage.get_instancec                 C   rD   )rE   z%<Twilio.Conversations.V1.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 )a  
        Initialize the BindingContext

        :param Version version: Version that contains the resource
        :param chat_service_sid: The SID of the Conversation Service that the resource is associated with.
        :param sid: A 34 character string that uniquely identifies this resource.

        :returns: twilio.rest.conversations.v1.service.binding.BindingContext
        :rtype: twilio.rest.conversations.v1.service.binding.BindingContext
        r<   z+/Services/{chat_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   s   | j jd| jdS )~
        Deletes the BindingInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr+   r,   )r   deleter   rF   r   r   r   rV      s   zBindingContext.deletec                 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.conversations.v1.service.binding.BindingInstance
        r*   rU   r
   r=   r<   )r   fetchr   rO   r   rP   r   r   r   rX      s   zBindingContext.fetchc                 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.Conversations.V1.BindingContext {}>joinr   itemsr   r   contextr   r   r   rG         
zBindingContext.__repr__)rI   rJ   rK   r   rV   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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apngcmfcmN)rI   rJ   rK   APNGCMFCMr   r   r   r   r&     s    r&   Nc                    s   t t| | |d|d|d|dt|dt|d|d|d|d	|d
|dd| _d| _||pH| jd d| _dS )z
        Initialize the BindingInstance

        :returns: twilio.rest.conversations.v1.service.binding.BindingInstance
        :rtype: twilio.rest.conversations.v1.service.binding.BindingInstance
        r=   account_sidr
   credential_siddate_createddate_updatedendpointr   r   message_typesurl)r=   rp   r
   rq   rr   rs   rt   r   r   ru   rv   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 )a6  
        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.conversations.v1.service.binding.BindingContext
        Nr
   r=   r<   )ry   r?   r   r   rF   r   r   r   _proxy&  s   
	zBindingInstance._proxyc                 C   
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        r=   rx   rF   r   r   r   r=   7     
zBindingInstance.sidc                 C   r{   )zn
        :returns: The unique ID of the Account responsible for this binding.
        :rtype: unicode
        rp   r|   rF   r   r   r   rp   ?  r}   zBindingInstance.account_sidc                 C   r{   )z}
        :returns: The SID of the Conversation Service that the resource is associated with.
        :rtype: unicode
        r
   r|   rF   r   r   r   r
   G  r}   z BindingInstance.chat_service_sidc                 C   r{   )z^
        :returns: The SID of the Credential for the binding.
        :rtype: unicode
        rq   r|   rF   r   r   r   rq   O  r}   zBindingInstance.credential_sidc                 C   r{   )z]
        :returns: The date that this resource was created.
        :rtype: datetime
        rr   r|   rF   r   r   r   rr   W  r}   zBindingInstance.date_createdc                 C   r{   )zb
        :returns: The date that this resource was last updated.
        :rtype: datetime
        rs   r|   rF   r   r   r   rs   _  r}   zBindingInstance.date_updatedc                 C   r{   )zc
        :returns: The unique endpoint identifier for the Binding.
        :rtype: unicode
        rt   r|   rF   r   r   r   rt   g  r}   zBindingInstance.endpointc                 C   r{   )zs
        :returns: The identity of Conversation User associated with this binding.
        :rtype: unicode
        r   r|   rF   r   r   r   r   o  r}   zBindingInstance.identityc                 C   r{   )zs
        :returns: The push technology to use for the binding.
        :rtype: BindingInstance.BindingType
        r   r|   rF   r   r   r   r   w  r}   zBindingInstance.binding_typec                 C   r{   )zv
        :returns: The Conversation message types the binding is subscribed to.
        :rtype: list[unicode]
        ru   r|   rF   r   r   r   ru     r}   zBindingInstance.message_typesc                 C   r{   )zU
        :returns: An absolute URL for this binding.
        :rtype: unicode
        rv   r|   rF   r   r   r   rv     r}   zBindingInstance.urlc                 C   
   | j  S )rS   )rz   rV   rF   r   r   r   rV        
zBindingInstance.deletec                 C   r~   )rW   )rz   rX   rF   r   r   r   rX     r   zBindingInstance.fetchc                 C   rY   )rE   rZ   c                 s   r[   r\   r]   r^   r   r   r   rb     rc   z+BindingInstance.__repr__.<locals>.<genexpr>z,<Twilio.Conversations.V1.BindingInstance {}>rd   rg   r   r   r   rG     ri   zBindingInstance.__repr__r!   )rI   rJ   rK   objectr&   r   propertyrz   r=   rp   r
   rq   rr   rs   rt   r   r   ru   rv   rV   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