o
    �¨ÊhÏ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dZ‡ fdd„Zejejejejfdd„Zejejejejddfdd„Zejejejejddfd	d
„Z	ejej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úk 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 )a#  
        Initialize the BindingList

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

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

zBindingList.__init__c           
   
   C   sP   t  |||t |dd„ ¡|||dœ¡}| jjd| j|d�}	t| j|	| jd d�S )a   
        Create a new BindingInstance

        :param unicode identity: The Identity to which this Binding belongs to.
        :param BindingInstance.BindingType binding_type: The type of the Binding.
        :param unicode address: The address specific to the channel.
        :param unicode tag: The list of tags associated with this Binding.
        :param unicode notification_protocol_version: The version of the protocol used to send the notification.
        :param unicode credential_sid: The unique identifier of the Credential resource to be used to send notifications to this Binding.
        :param unicode endpoint: DEPRECATED*

        :returns: Newly created BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingInstance
        c                 S   ó   | S ©Nr   ©Úer   r   r   Ú<lambda>;   ó    z$BindingList.create.<locals>.<lambda>)ÚIdentityÚBindingTypeÚAddressÚTagÚNotificationProtocolVersionÚCredentialSidÚEndpointÚPOST)Údatar   ©r   )	r   Úofr   ÚmapÚ_versionÚcreater   ÚBindingInstancer   )
r   ÚidentityÚbinding_typeÚaddressÚtagÚnotification_protocol_versionÚcredential_sidÚendpointr%   Úpayloadr   r   r   r*   &   s   ù
ýzBindingList.createNc           	      C   s>   | j  ||¡}| j|||||d d�}| j  ||d |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 date start_date: Only list Bindings created on or after the given date.
        :param date end_date: Only list Bindings created on or before the given date.
        :param unicode identity: Only list Bindings that have any of the specified Identities.
        :param unicode tag: Only list Bindings that have all of the specified Tags.
        :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.notify.v1.service.binding.BindingInstance]
        Ú	page_size)Ú
start_dateÚend_dater,   r/   r4   ÚlimitÚ
page_limit)r)   Úread_limitsÚpageÚstream)	r   r5   r6   r,   r/   r7   r4   Úlimitsr:   r   r   r   r;   I   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 date start_date: Only list Bindings created on or after the given date.
        :param date end_date: Only list Bindings created on or before the given date.
        :param unicode identity: Only list Bindings that have any of the specified Identities.
        :param unicode tag: Only list Bindings that have all of the specified Tags.
        :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.notify.v1.service.binding.BindingInstance]
        )r5   r6   r,   r/   r7   r4   )Úlistr;   )r   r5   r6   r,   r/   r7   r4   r   r   r   r=   k   s   úzBindingList.listc           
   
   C   sb   t  t |¡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 date start_date: Only list Bindings created on or after the given date.
        :param date end_date: Only list Bindings created on or before the given date.
        :param unicode identity: Only list Bindings that have any of the specified Identities.
        :param unicode tag: Only list Bindings that have all of the specified Tags.
        :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.notify.v1.service.binding.BindingPage
        c                 S   r   r   r   r   r   r   r   r   ž   r   z"BindingList.page.<locals>.<lambda>c                 S   r   r   r   r   r   r   r   r   Ÿ   r   )Ú	StartDateÚEndDater   r    Ú	PageTokenr   ÚPageSizeÚGET©Úparams)
r   r'   r   Úiso8601_dater(   r)   r:   r   ÚBindingPager   )
r   r5   r6   r,   r/   Ú
page_tokenÚpage_numberr4   rD   Úresponser   r   r   r:   ‰   s   ù
ýzBindingList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a9  
        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.notify.v1.service.binding.BindingPage
        rB   )r)   ÚdomainÚtwilioÚrequestrF   r   )r   Ú
target_urlrI   r   r   r   Úget_page­   s
   

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

        :param sid: The sid

        :returns: twilio.rest.notify.v1.service.binding.BindingContext
        :rtype: twilio.rest.notify.v1.service.binding.BindingContext
        r   ©r   Úsid©ÚBindingContextr)   r   ©r   rR   r   r   r   Úget¾   ó   	zBindingList.getc                 C   rO   rP   rS   rU   r   r   r   Ú__call__É   rW   zBindingList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Notify.V1.BindingList>r   ©r   r   r   r   Ú__repr__Ô   ó   zBindingList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr*   r;   r=   r:   rN   rV   rX   r\   Ú__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 )rF   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 service_sid

        :returns: twilio.rest.notify.v1.service.binding.BindingPage
        :rtype: twilio.rest.notify.v1.service.binding.BindingPage
        N)r   rF   r   r   )r   r   rI   Ú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.notify.v1.service.binding.BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingInstance
        r   r&   )r+   r)   r   )r   r3   r   r   r   Úget_instanceò   rW   zBindingPage.get_instancec                 C   rY   )rZ   z<Twilio.Notify.V1.BindingPage>r   r[   r   r   r   r\   ý   r]   zBindingPage.__repr__)r^   r_   r`   ra   r   re   r\   rc   r   r   r   r   rF   Þ   s
    rF   c                       s8   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Z‡  ZS )
rT   r
   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )aH  
        Initialize the BindingContext

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

        :returns: twilio.rest.notify.v1.service.binding.BindingContext
        :rtype: twilio.rest.notify.v1.service.binding.BindingContext
        rQ   z&/Services/{service_sid}/Bindings/{sid}Nr   )r   rT   r   r   r   r   )r   r   r   rR   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.notify.v1.service.binding.BindingInstance
        rB   rC   r   rR   rQ   )r   r'   r)   Úfetchr   r+   r   )r   rD   r3   r   r   r   rg     s   
ýüzBindingContext.fetchc                 C   s   | j  d| j¡S )ú~
        Deletes the BindingInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r)   ri   r   r[   r   r   r   ri   2  s   zBindingContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rZ   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>B  ó   € z*BindingContext.__repr__.<locals>.<genexpr>z$<Twilio.Notify.V1.BindingContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   r\   ;  ó   
zBindingContext.__repr__)	r^   r_   r`   ra   r   rg   ri   r\   rc   r   r   r   r   rT     s    	rT   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ed!d"„ ƒZed#d$„ ƒZd%d&„ Zd'd(„ Zd)d*„ Z‡  ZS ),r+   r
   c                   @   s$   e Zd ZdZdZdZdZdZdZdS )zBindingInstance.BindingTypeÚapnÚgcmÚsmsÚfcmzfacebook-messengerÚalexaN)	r^   r_   r`   ÚAPNÚGCMÚSMSÚFCMÚFACEBOOK_MESSENGERÚALEXAr   r   r   r   r   J  s    r   Nc                    s˜   t t| ƒ |¡ |d |d |d |d t |d ¡t |d ¡|d |d |d	 |d
 |d |d |d |d dœ| _d| _||pF| jd dœ| _dS )z¿
        Initialize the BindingInstance

        :returns: twilio.rest.notify.v1.service.binding.BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingInstance
        rR   Úaccount_sidr   r1   Údate_createdÚdate_updatedr0   r2   r,   r-   r.   ÚtagsÚurlÚlinks)rR   r†   r   r1   r‡   rˆ   r0   r2   r,   r-   r.   r‰   rŠ   r‹   NrQ   )r   r+   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   r3   r   rR   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.notify.v1.service.binding.BindingContext
        Nr   rR   rQ   )rŽ   rT   r)   r   r[   r   r   r   Ú_proxyq  s   
	ýzBindingInstance._proxyc                 C   ó
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        rR   ©r�   r[   r   r   r   rR   ‚  ó   
zBindingInstance.sidc                 C   r�   )zC
        :returns: The account_sid
        :rtype: unicode
        r†   r‘   r[   r   r   r   r†   Š  r’   zBindingInstance.account_sidc                 C   r�   )zC
        :returns: The service_sid
        :rtype: unicode
        r   r‘   r[   r   r   r   r   ’  r’   zBindingInstance.service_sidc                 C   r�   )z–
        :returns: The unique identifier of the Credential resource to be used to send notifications to this Binding.
        :rtype: unicode
        r1   r‘   r[   r   r   r   r1   š  r’   zBindingInstance.credential_sidc                 C   r�   )zE
        :returns: The date_created
        :rtype: datetime
        r‡   r‘   r[   r   r   r   r‡   ¢  r’   zBindingInstance.date_createdc                 C   r�   )zE
        :returns: The date_updated
        :rtype: datetime
        rˆ   r‘   r[   r   r   r   rˆ   ª  r’   zBindingInstance.date_updatedc                 C   r�   )zn
        :returns: The version of the protocol used to send the notification.
        :rtype: unicode
        r0   r‘   r[   r   r   r   r0   ²  r’   z-BindingInstance.notification_protocol_versionc                 C   r�   )z?
        :returns: DEPRECATED*
        :rtype: unicode
        r2   r‘   r[   r   r   r   r2   º  r’   zBindingInstance.endpointc                 C   r�   )zb
        :returns: The Identity to which this Binding belongs to.
        :rtype: unicode
        r,   r‘   r[   r   r   r   r,   Â  r’   zBindingInstance.identityc                 C   r�   )zL
        :returns: The type of the Binding.
        :rtype: unicode
        r-   r‘   r[   r   r   r   r-   Ê  r’   zBindingInstance.binding_typec                 C   r�   )zX
        :returns: The address specific to the channel.
        :rtype: unicode
        r.   r‘   r[   r   r   r   r.   Ò  r’   zBindingInstance.addressc                 C   r�   )zb
        :returns: The list of tags associated with this Binding.
        :rtype: unicode
        r‰   r‘   r[   r   r   r   r‰   Ú  r’   zBindingInstance.tagsc                 C   r�   )z;
        :returns: The url
        :rtype: unicode
        rŠ   r‘   r[   r   r   r   rŠ   â  r’   zBindingInstance.urlc                 C   r�   )z=
        :returns: The links
        :rtype: unicode
        r‹   r‘   r[   r   r   r   r‹   ê  r’   zBindingInstance.linksc                 C   ó
   | j  ¡ S )rf   )r�   rg   r[   r   r   r   rg   ò  ó   
zBindingInstance.fetchc                 C   r“   )rh   )r�   ri   r[   r   r   r   ri   û  r”   zBindingInstance.deletec                 C   rj   )rZ   rk   c                 s   rl   rm   rn   ro   r   r   r   rs     rt   z+BindingInstance.__repr__.<locals>.<genexpr>z%<Twilio.Notify.V1.BindingInstance {}>ru   rx   r   r   r   r\     rz   zBindingInstance.__repr__r   )r^   r_   r`   ra   Úobjectr   r   Úpropertyr�   rR   r†   r   r1   r‡   rˆ   r0   r2   r,   r-   r.   r‰   rŠ   r‹   rg   ri   r\   rc   r   r   r   r   r+   F  sJ    














		r+   N)ra   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   rF   rT   r+   r   r   r   r   Ú<module>   s    M)?