o
    �¨ÊhB9  ã                   @   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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 )ÚBindingListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )aE  
        Initialize the BindingList

        :param Version version: Version that contains the resource
        :param service_sid: The unique id of the Service this binding belongs to.

        :returns: twilio.rest.chat.v2.service.binding.BindingList
        :rtype: twilio.rest.chat.v2.service.binding.BindingList
        Úservice_sidz /Services/{service_sid}/BindingsN© )Úsuperr	   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   ©Ú	__class__r   úU/var/www/html/env/lib/python3.10/site-packages/twilio/rest/chat/v2/service/binding.pyr      s   

zBindingList.__init__Nc                 C   s:   | j  ||¡}| j|||d d�}| j  ||d |d ¡S )aZ  
        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 BindingInstance.BindingType binding_type: The push technology used for the bindings returned.
        :param 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.chat.v2.service.binding.BindingInstance]
        Ú	page_size)Úbinding_typeÚidentityr   ÚlimitÚ
page_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 BindingInstance.BindingType binding_type: The push technology used for the bindings returned.
        :param 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.chat.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 )aZ  
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param BindingInstance.BindingType binding_type: The push technology used for the bindings returned.
        :param 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.chat.v2.service.binding.BindingPage
        c                 S   ó   | S ©Nr   ©Úer   r   r   Ú<lambda>j   ó    z"BindingList.page.<locals>.<lambda>c                 S   r"   r#   r   r$   r   r   r   r&   k   r'   )ÚBindingTypeÚIdentityÚ	PageTokenr   ÚPageSizeÚGET©Úparams)	r   Úofr   Úmapr   r   r   ÚBindingPager   )r   r   r   Ú
page_tokenÚpage_numberr   r.   Úresponser   r   r   r   Y   s   ûýzBindingList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a7  
        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.chat.v2.service.binding.BindingPage
        r,   )r   ÚdomainÚtwilioÚrequestr1   r   )r   Ú
target_urlr4   r   r   r   Úget_pagey   s
   

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

        :param sid: The sid

        :returns: twilio.rest.chat.v2.service.binding.BindingContext
        :rtype: twilio.rest.chat.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.Chat.V2.BindingList>r   ©r   r   r   r   Ú__repr__    ó   zBindingList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr   r!   r   r9   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 )r1   r
   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 service_sid: The unique id of the Service this binding belongs to.

        :returns: twilio.rest.chat.v2.service.binding.BindingPage
        :rtype: twilio.rest.chat.v2.service.binding.BindingPage
        N)r   r1   r   r   )r   r   r4   Úsolutionr   r   r   r   ­   s   
zBindingPage.__init__c                 C   s   t | j|| jd d�S )zý
        Build an instance of BindingInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.chat.v2.service.binding.BindingInstance
        :rtype: twilio.rest.chat.v2.service.binding.BindingInstance
        r   )r   )ÚBindingInstancer   r   )r   Úpayloadr   r   r   Úget_instance½   rB   zBindingPage.get_instancec                 C   rD   )rE   z<Twilio.Chat.V2.BindingPage>r   rF   r   r   r   rG   È   rH   zBindingPage.__repr__)rI   rJ   rK   rL   r   rR   rG   rN   r   r   r   r   r1   ª   s
    r1   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 )aD  
        Initialize the BindingContext

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

        :returns: twilio.rest.chat.v2.service.binding.BindingContext
        :rtype: twilio.rest.chat.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   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú˜
        Fetch a BindingInstance

        :returns: Fetched BindingInstance
        :rtype: twilio.rest.chat.v2.service.binding.BindingInstance
        r,   r-   r   r=   r<   )r   r/   r   Úfetchr   rP   r   )r   r.   rQ   r   r   r   rT   æ   s   
ýüzBindingContext.fetchc                 C   s   | j  d| j¡S )ú~
        Deletes the BindingInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rV   r   rF   r   r   r   rV   ü   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.Chat.V2.BindingContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rG     ó   
zBindingContext.__repr__)	rI   rJ   rK   rL   r   rT   rV   rG   rN   r   r   r   r   r?   Ò   s    	r?   c                       sæ   e Zd 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 )(rP   r
   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| _||p@| jd dœ| _dS )z»
        Initialize the BindingInstance

        :returns: twilio.rest.chat.v2.service.binding.BindingInstance
        :rtype: twilio.rest.chat.v2.service.binding.BindingInstance
        r=   Úaccount_sidr   Údate_createdÚdate_updatedÚendpointr   Úcredential_sidr   Úmessage_typesÚurlÚlinks)r=   rn   r   ro   rp   rq   r   rr   r   rs   rt   ru   Nr<   )r   rP   r   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 )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: BindingContext for this BindingInstance
        :rtype: twilio.rest.chat.v2.service.binding.BindingContext
        Nr   r=   r<   )rx   r?   r   r   rF   r   r   r   Ú_proxy5  s   
	ýzBindingInstance._proxyc                 C   ó
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        r=   ©rw   rF   r   r   r   r=   F  ó   
zBindingInstance.sidc                 C   rz   )zn
        :returns: The unique id of the Account responsible for this binding.
        :rtype: unicode
        rn   r{   rF   r   r   r   rn   N  r|   zBindingInstance.account_sidc                 C   rz   )zi
        :returns: The unique id of the Service this binding belongs to.
        :rtype: unicode
        r   r{   rF   r   r   r   r   V  r|   zBindingInstance.service_sidc                 C   rz   )z]
        :returns: The date that this resource was created.
        :rtype: datetime
        ro   r{   rF   r   r   r   ro   ^  r|   zBindingInstance.date_createdc                 C   rz   )zb
        :returns: The date that this resource was last updated.
        :rtype: datetime
        rp   r{   rF   r   r   r   rp   f  r|   zBindingInstance.date_updatedc                 C   rz   )zd
        :returns: The unique endpoint identifier for this Binding.
        :rtype: unicode
        rq   r{   rF   r   r   r   rq   n  r|   zBindingInstance.endpointc                 C   rz   )z}
        :returns: A unique string identifier for the Binding for this User in this Service.
        :rtype: unicode
        r   r{   rF   r   r   r   r   v  r|   zBindingInstance.identityc                 C   rz   )ze
        :returns: The unique id of the Credential for this binding.
        :rtype: unicode
        rr   r{   rF   r   r   r   rr   ~  r|   zBindingInstance.credential_sidc                 C   rz   )zt
        :returns: The push technology to use for this binding.
        :rtype: BindingInstance.BindingType
        r   r{   rF   r   r   r   r   †  r|   zBindingInstance.binding_typec                 C   rz   )z[
        :returns: List of message types for this binding.
        :rtype: unicode
        rs   r{   rF   r   r   r   rs   Ž  r|   zBindingInstance.message_typesc                 C   rz   )zU
        :returns: An absolute URL for this binding.
        :rtype: unicode
        rt   r{   rF   r   r   r   rt   –  r|   zBindingInstance.urlc                 C   rz   )zg
        :returns: Absolute URLs to access the Users for this Binding.
        :rtype: unicode
        ru   r{   rF   r   r   r   ru   ž  r|   zBindingInstance.linksc                 C   ó
   | j  ¡ S )rS   )ry   rT   rF   r   r   r   rT   ¦  ó   
zBindingInstance.fetchc                 C   r}   )rU   )ry   rV   rF   r   r   r   rV   ¯  r~   zBindingInstance.deletec                 C   rW   )rE   rX   c                 s   rY   rZ   r[   r\   r   r   r   r`   ¿  ra   z+BindingInstance.__repr__.<locals>.<genexpr>z#<Twilio.Chat.V2.BindingInstance {}>rb   re   r   r   r   rG   ¸  rg   zBindingInstance.__repr__r#   )rI   rJ   rK   rL   Úobjectr(   r   Úpropertyry   r=   rn   r   ro   rp   rq   r   rr   r   rs   rt   ru   rT   rV   rG   rN   r   r   r   r   rP     sB    












		rP   N)rL   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r1   r?   rP   r   r   r   r   Ú<module>   s    (>