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 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
      /       /
    )	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	WebhookListc                    s   t t| | d|i| _dS )aq  
        Initialize the WebhookList

        :param Version version: Version that contains the resource
        :param chat_service_sid: The unique string that identifies the resource

        :returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookList
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookList
        chat_service_sidN)superr   __init__	_solutionselfversionr	   	__class__ m/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/service/configuration/webhook.pyr      s   
zWebhookList.__init__c                 C      t | j| jd dS z
        Constructs a WebhookContext

        :returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookContext
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookContext
        r	   r	   WebhookContext_versionr   r   r   r   r   get"      zWebhookList.getc                 C   r   r   r   r   r   r   r   __call__+   r   zWebhookList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Conversations.V1.WebhookList>r   r   r   r   r   __repr__4      zWebhookList.__repr__)__name__
__module____qualname__r   r   r   r    __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 )WebhookPagec                    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 chat_service_sid: The unique string that identifies the resource

        :returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookPage
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookPage
        N)r
   r&   r   r   )r   r   responsesolutionr   r   r   r   @   s   
zWebhookPage.__init__c                 C   s   t | j|| jd dS )a+  
        Build an instance of WebhookInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookInstance
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookInstance
        r	   r   )WebhookInstancer   r   r   payloadr   r   r   get_instanceP   s   	zWebhookPage.get_instancec                 C   r   )r   z%<Twilio.Conversations.V1.WebhookPage>r   r   r   r   r   r    [   r!   zWebhookPage.__repr__)r"   r#   r$   r   r,   r    r%   r   r   r   r   r&   >   s    r&   c                       sF   e Zd Z fddZejejejejfddZdd Zdd Z  Z	S )	r   c                    s2   t t| | d|i| _djdi | j| _dS )a  
        Initialize the WebhookContext

        :param Version version: Version that contains the resource
        :param chat_service_sid: The unique ID of the `Conversation Service <https://www.twilio.com/docs/conversations/api/service-resource>`_ this conversation belongs to.

        :returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookContext
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookContext
        r	   z3/Services/{chat_service_sid}/Configuration/WebhooksNr   )r
   r   r   r   format_urir   r   r   r   r   g   s   

zWebhookContext.__init__c              	   C   sJ   t ||t|dd |d}| jjd| j|d}t| j|| jd dS )|  
        Update the WebhookInstance

        :param unicode pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
        :param unicode post_webhook_url: The absolute url the post-event webhook request should be sent to.
        :param list[unicode] filters: The list of events that your configured webhook targets will receive. Events not configured here will not fire.
        :param unicode method: The HTTP method to be used when sending a webhook request

        :returns: The updated WebhookInstance
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookInstance
        c                 S   s   | S )Nr   )er   r   r   <lambda>   s    z'WebhookContext.update.<locals>.<lambda>)PreWebhookUrlPostWebhookUrlFiltersMethodPOST)methoduridatar	   r   )	r   ofr   mapr   updater.   r)   r   )r   pre_webhook_urlpost_webhook_urlfiltersr7   r9   r+   r   r   r   r<   w   s   zWebhookContext.updatec                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the WebhookInstance

        :returns: The fetched WebhookInstance
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookInstance
        GET)r7   r8   r	   r   )r   fetchr.   r)   r   r*   r   r   r   rB      s   zWebhookContext.fetchc                 C   $   d dd | j D }d|S )r    c                 s        | ]\}}d  ||V  qdS z{}={}Nr-   .0kvr   r   r   	<genexpr>       z*WebhookContext.__repr__.<locals>.<genexpr>z+<Twilio.Conversations.V1.WebhookContext {}>joinr   itemsr-   r   contextr   r   r   r          
zWebhookContext.__repr__)
r"   r#   r$   r   r   unsetr<   rB   r    r%   r   r   r   r   r   e   s    
r   c                       s   e Zd ZG dd deZ 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jejejejfddZdd Zdd Z  ZS )r)   c                   @   s   e Zd ZdZdZdS )zWebhookInstance.MethodrA   r6   N)r"   r#   r$   rA   r6   r   r   r   r   r5      s    r5   c              	      sd   t t| | |d|d|d|d|d|d|dd| _d	| _d|i| _d	S )
z
        Initialize the WebhookInstance

        :returns: twilio.rest.conversations.v1.service.configuration.webhook.WebhookInstance
        :rtype: twilio.rest.conversations.v1.service.configuration.webhook.WebhookInstance
        account_sidr	   r=   r>   r?   r7   url)rU   r	   r=   r>   r?   r7   rV   N)r
   r)   r   r   _properties_contextr   )r   r   r+   r	   r   r   r   r      s   zWebhookInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )aD  
        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.conversations.v1.service.configuration.webhook.WebhookContext
        Nr	   r   )rX   r   r   r   r   r   r   r   _proxy   s   
	zWebhookInstance._proxyc                 C   
   | j d S )zn
        :returns: The unique ID of the Account responsible for this service.
        :rtype: unicode
        rU   rW   r   r   r   r   rU         
zWebhookInstance.account_sidc                 C   rZ   )z
        :returns: The unique ID of the `Conversation Service <https://www.twilio.com/docs/conversations/api/service-resource>`_ this conversation belongs to.
        :rtype: unicode
        r	   r[   r   r   r   r   r	      r\   z WebhookInstance.chat_service_sidc                 C   rZ   )zu
        :returns: The absolute url the pre-event webhook request should be sent to.
        :rtype: unicode
        r=   r[   r   r   r   r   r=      r\   zWebhookInstance.pre_webhook_urlc                 C   rZ   )zv
        :returns: The absolute url the post-event webhook request should be sent to.
        :rtype: unicode
        r>   r[   r   r   r   r   r>      r\   z WebhookInstance.post_webhook_urlc                 C   rZ   )z
        :returns: The list of events that your configured webhook targets will receive. Events not configured here will not fire.
        :rtype: list[unicode]
        r?   r[   r   r   r   r   r?      r\   zWebhookInstance.filtersc                 C   rZ   )z|
        :returns: The HTTP method to be used when sending a webhook request
        :rtype: WebhookInstance.Method
        r7   r[   r   r   r   r   r7      r\   zWebhookInstance.methodc                 C   rZ   )zU
        :returns: An absolute URL for this webhook.
        :rtype: unicode
        rV   r[   r   r   r   r   rV      r\   zWebhookInstance.urlc                 C   s   | j j||||dS )r/   )r=   r>   r?   r7   )rY   r<   )r   r=   r>   r?   r7   r   r   r   r<     s   zWebhookInstance.updatec                 C   s
   | j  S )r@   )rY   rB   r   r   r   r   rB     s   
zWebhookInstance.fetchc                 C   rC   )r   rD   c                 s   rE   rF   rG   rH   r   r   r   rL   ,  rM   z+WebhookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Conversations.V1.WebhookInstance {}>rN   rQ   r   r   r   r    %  rS   zWebhookInstance.__repr__)r"   r#   r$   objectr5   r   propertyrY   rU   r	   r=   r>   r?   r7   rV   r   rT   r<   rB   r    r%   r   r   r   r   r)      s0    








	r)   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r&   r   r)   r   r   r   r   <module>   s   -'@