o
    �¨ÊhÓG  ã                   @   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ddd„Zddd„Zejejejfd	d
„Z	dd„ Z
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‡  ZS )ÚWebhookListú  c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a[  
        Initialize the WebhookList

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

        :returns: twilio.rest.chat.v2.service.channel.webhook.WebhookList
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookList
        ©Úservice_sidÚchannel_sidz7/Services/{service_sid}/Channels/{channel_sid}/WebhooksN© )Úsuperr	   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   r   ©Ú	__class__r   ú]/var/www/html/env/lib/python3.10/site-packages/twilio/rest/chat/v2/service/channel/webhook.pyr      s   zWebhookList.__init__Nc                 C   s6   | j  ||¡}| j|d d�}| j  ||d |d ¡S )aÇ  
        Streams WebhookInstance 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.chat.v2.service.channel.webhook.WebhookInstance]
        Ú	page_size)r   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   Úlimitsr   r   r   r   r   &   s   zWebhookList.streamc                 C   s   t | j||d�ƒS )ag  
        Lists WebhookInstance 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.chat.v2.service.channel.webhook.WebhookInstance]
        )r   r   )Úlistr   )r   r   r   r   r   r   r!   =   s   zWebhookList.listc                 C   s6   t  |||dœ¡}| jjd| j|d�}t| j|| jƒS )aÇ  
        Retrieve a single page of WebhookInstance 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 WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookPage
        )Ú	PageTokenr   ÚPageSizeÚGET©Úparams)r   Úofr   r   r   ÚWebhookPager   )r   Ú
page_tokenÚpage_numberr   r&   Úresponser   r   r   r   O   s   ýzWebhookList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a?  
        Retrieve a specific page of WebhookInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookPage
        r$   )r   ÚdomainÚtwilioÚrequestr(   r   )r   Ú
target_urlr+   r   r   r   Úget_pagef   s
   

þzWebhookList.get_pagec           
      C   sd   t  |||t |dd„ ¡t |dd„ ¡||dœ¡}| jjd| j|d�}	t| j|	| jd | jd d	�S )
a   
        Create a new WebhookInstance

        :param WebhookInstance.Type type: The type
        :param unicode configuration_url: The configuration.url
        :param WebhookInstance.Method configuration_method: The configuration.method
        :param unicode configuration_filters: The configuration.filters
        :param unicode configuration_triggers: The configuration.triggers
        :param unicode configuration_flow_sid: The configuration.flow_sid
        :param unicode configuration_retry_count: The configuration.retry_count

        :returns: Newly created WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        c                 S   ó   | S ©Nr   ©Úer   r   r   Ú<lambda>�   ó    z$WebhookList.create.<locals>.<lambda>c                 S   r1   r2   r   r3   r   r   r   r5   �   r6   )ÚTypeúConfiguration.UrlúConfiguration.MethodúConfiguration.FiltersúConfiguration.TriggersúConfiguration.FlowSidúConfiguration.RetryCountÚPOST©Údatar   r   r   )	r   r'   r   Úmapr   Úcreater   ÚWebhookInstancer   )
r   ÚtypeÚconfiguration_urlÚconfiguration_methodÚconfiguration_filtersÚconfiguration_triggersÚconfiguration_flow_sidÚconfiguration_retry_countr@   Úpayloadr   r   r   rB   w   s(   ù
ýüzWebhookList.createc                 C   ó   t | j| jd | jd |d�S ©zã
        Constructs a WebhookContext

        :param sid: The sid

        :returns: twilio.rest.chat.v2.service.channel.webhook.WebhookContext
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookContext
        r   r   ©r   r   Úsid©ÚWebhookContextr   r   ©r   rO   r   r   r   Úget¢   ó   	üzWebhookList.getc                 C   rL   rM   rP   rR   r   r   r   Ú__call__²   rT   zWebhookList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Chat.V2.WebhookList>r   ©r   r   r   r   Ú__repr__Â   ó   zWebhookList.__repr__)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r!   r   Úunsetr   r0   rB   rS   rU   rY   Ú__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 )r(   r
   c                    s   t t| ƒ ||¡ || _dS )a“  
        Initialize the WebhookPage

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

        :returns: twilio.rest.chat.v2.service.channel.webhook.WebhookPage
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookPage
        N)r   r(   r   r   )r   r   r+   Úsolutionr   r   r   r   Ï   s   
zWebhookPage.__init__c                 C   s   t | j|| jd | jd d�S )a  
        Build an instance of WebhookInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        r   r   r   )rC   r   r   )r   rK   r   r   r   Úget_instanceà   s   	üzWebhookPage.get_instancec                 C   rV   )rW   z<Twilio.Chat.V2.WebhookPage>r   rX   r   r   r   rY   ð   rZ   zWebhookPage.__repr__)r[   r\   r]   r^   r   rb   rY   r`   r   r   r   r   r(   Ì   s
    r(   c                       sZ   e Zd ZdZ‡ fdd„Zdd„ Zejejejejejejfdd„Zdd	„ Z	d
d„ Z
‡  ZS )rQ   r
   c                    s6   t t| ƒ |¡ |||dœ| _djdi | j¤Ž| _dS )a€  
        Initialize the WebhookContext

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

        :returns: twilio.rest.chat.v2.service.channel.webhook.WebhookContext
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookContext
        rN   z=/Services/{service_sid}/Channels/{channel_sid}/Webhooks/{sid}Nr   )r   rQ   r   r   r   r   )r   r   r   r   rO   r   r   r   r   ý   s   zWebhookContext.__init__c                 C   sD   t  i ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )ú 
        Fetch a WebhookInstance

        :returns: Fetched WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        r$   r%   r   r   rO   rN   )r   r'   r   Úfetchr   rC   r   )r   r&   rK   r   r   r   rd     s   
ýûzWebhookContext.fetchc           	   
   C   sj   t  ||t |dd„ ¡t |dd„ ¡||dœ¡}| jjd| j|d�}t| j|| jd | jd | jd	 d
�S )áe  
        Update the WebhookInstance

        :param unicode configuration_url: The configuration.url
        :param WebhookInstance.Method configuration_method: The configuration.method
        :param unicode configuration_filters: The configuration.filters
        :param unicode configuration_triggers: The configuration.triggers
        :param unicode configuration_flow_sid: The configuration.flow_sid
        :param unicode configuration_retry_count: The configuration.retry_count

        :returns: Updated WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        c                 S   r1   r2   r   r3   r   r   r   r5   <  r6   z'WebhookContext.update.<locals>.<lambda>c                 S   r1   r2   r   r3   r   r   r   r5   =  r6   )r8   r9   r:   r;   r<   r=   r>   r?   r   r   rO   rN   )	r   r'   r   rA   r   Úupdater   rC   r   )	r   rE   rF   rG   rH   rI   rJ   r@   rK   r   r   r   rf   &  s(   ú	ýûzWebhookContext.updatec                 C   s   | j  d| j¡S )ú~
        Deletes the WebhookInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rh   r   rX   r   r   r   rh   P  s   zWebhookContext.deletec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rW   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>`  ó   € z*WebhookContext.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V2.WebhookContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rY   Y  ó   
zWebhookContext.__repr__)r[   r\   r]   r^   r   rd   r   r_   rf   rh   rY   r`   r   r   r   r   rQ   ú   s    
û*	rQ   c                       sô   e Zd ZdZG dd„ deƒ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dd„ Zejejejejejejfdd „Zd!d"„ Zd#d$„ Z‡  ZS )&rC   r
   c                   @   s   e Zd ZdZdZdZdS )zWebhookInstance.TypeÚwebhookÚtriggerÚstudioN)r[   r\   r]   ÚWEBHOOKÚTRIGGERÚSTUDIOr   r   r   r   r7   g  s    r7   c                   @   s   e Zd ZdZdZdS )zWebhookInstance.Methodr$   r>   N)r[   r\   r]   r$   r>   r   r   r   r   ÚMethodl  s    r€   Nc                    s|   t t| ƒ |¡ |d |d |d |d |d |d |d t |d ¡t |d	 ¡d
œ	| _d| _|||p8| jd dœ| _dS )zË
        Initialize the WebhookInstance

        :returns: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
        rO   Úaccount_sidr   r   rD   ÚurlÚconfigurationÚdate_createdÚdate_updated)	rO   r�   r   r   rD   r‚   rƒ   r„   r…   NrN   )r   rC   r   r   Úiso8601_datetimeÚ_propertiesÚ_contextr   )r   r   rK   r   r   rO   r   r   r   r   p  s    ÷ýzWebhookInstance.__init__c                 C   s6   | j du rt| j| jd | 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: WebhookContext for this WebhookInstance
        :rtype: twilio.rest.chat.v2.service.channel.webhook.WebhookContext
        Nr   r   rO   rN   )rˆ   rQ   r   r   rX   r   r   r   Ú_proxyŽ  s   
	üzWebhookInstance._proxyc                 C   ó
   | j d S )z;
        :returns: The sid
        :rtype: unicode
        rO   ©r‡   rX   r   r   r   rO      ó   
zWebhookInstance.sidc                 C   rŠ   )zC
        :returns: The account_sid
        :rtype: unicode
        r�   r‹   rX   r   r   r   r�   ¨  rŒ   zWebhookInstance.account_sidc                 C   rŠ   )zC
        :returns: The service_sid
        :rtype: unicode
        r   r‹   rX   r   r   r   r   °  rŒ   zWebhookInstance.service_sidc                 C   rŠ   )zC
        :returns: The channel_sid
        :rtype: unicode
        r   r‹   rX   r   r   r   r   ¸  rŒ   zWebhookInstance.channel_sidc                 C   rŠ   )z<
        :returns: The type
        :rtype: unicode
        rD   r‹   rX   r   r   r   rD   À  rŒ   zWebhookInstance.typec                 C   rŠ   )z;
        :returns: The url
        :rtype: unicode
        r‚   r‹   rX   r   r   r   r‚   È  rŒ   zWebhookInstance.urlc                 C   rŠ   )zB
        :returns: The configuration
        :rtype: dict
        rƒ   r‹   rX   r   r   r   rƒ   Ð  rŒ   zWebhookInstance.configurationc                 C   rŠ   )zE
        :returns: The date_created
        :rtype: datetime
        r„   r‹   rX   r   r   r   r„   Ø  rŒ   zWebhookInstance.date_createdc                 C   rŠ   )zE
        :returns: The date_updated
        :rtype: datetime
        r…   r‹   rX   r   r   r   r…   à  rŒ   zWebhookInstance.date_updatedc                 C   ó
   | j  ¡ S )rc   )r‰   rd   rX   r   r   r   rd   è  ó   
zWebhookInstance.fetchc                 C   s   | j j||||||d�S )re   )rE   rF   rG   rH   rI   rJ   )r‰   rf   )r   rE   rF   rG   rH   rI   rJ   r   r   r   rf   ñ  s   úzWebhookInstance.updatec                 C   r�   )rg   )r‰   rh   rX   r   r   r   rh     rŽ   zWebhookInstance.deletec                 C   ri   )rW   rj   c                 s   rk   rl   rm   rn   r   r   r   rr     rs   z+WebhookInstance.__repr__.<locals>.<genexpr>z#<Twilio.Chat.V2.WebhookInstance {}>rt   rw   r   r   r   rY     ry   zWebhookInstance.__repr__r2   )r[   r\   r]   r^   Úobjectr7   r€   r   Úpropertyr‰   rO   r�   r   r   rD   r‚   rƒ   r„   r…   rd   r   r_   rf   rh   rY   r`   r   r   r   r   rC   d  sF    









	
û	rC   N)r^   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r(   rQ   rC   r   r   r   r   Ú<module>   s    ;.j