o
    f>h7                     @   s   d Z ddlmZmZmZmZmZ ddlmZ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dS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Conversations
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )AnyDictListOptionalUnion)	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s  e Zd ZG dd deZ	 dedeeef def fddZ	e
dd
dZdddZdddZejejejejfdeeef deeef deee ef deeef dd f
ddZejejejejfdeeef deeef deee ef deeef dd f
ddZdefddZ  ZS )WebhookInstancec                   @   s   e Zd ZdZdZdS )zWebhookInstance.MethodGETPOSTN)__name__
__module____qualname__r   r    r   r   m/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/service/configuration/webhook.pyMethod   s    r   versionpayloadchat_service_sidc                    st   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	d|i| _
d | _d S )Naccount_sidr   pre_webhook_urlpost_webhook_urlfiltersmethodurl)super__init__getr   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__r   r   r    '   s   
zWebhookInstance.__init__returnWebhookContextc                 C   s&   | j du rt| j| jd d| _ | j S )z
        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
        Nr   r   )r#   r(   _versionr"   r$   r   r   r   _proxy9   s   
zWebhookInstance._proxyc                 C   s
   | j  S )[
        Fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        )r,   fetchr+   r   r   r   r.   H   s   
zWebhookInstance.fetchc                    s   | j  I dH S )u
        Asynchronous coroutine to fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        N)r,   fetch_asyncr+   r   r   r   r0   Q   s   zWebhookInstance.fetch_asyncr   r   r   r   c                 C   s   | j j||||dS )  
        Update the WebhookInstance

        :param pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
        :param post_webhook_url: The absolute url the post-event webhook request should be sent to.
        :param filters: The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`.
        :param method: The HTTP method to be used when sending a webhook request. One of `GET` or `POST`.

        :returns: The updated WebhookInstance
        r   r   r   r   )r,   updater$   r   r   r   r   r   r   r   r3   Z   s   zWebhookInstance.updatec                    s   | j j||||dI dH S )  
        Asynchronous coroutine to update the WebhookInstance

        :param pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
        :param post_webhook_url: The absolute url the post-event webhook request should be sent to.
        :param filters: The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`.
        :param method: The HTTP method to be used when sending a webhook request. One of `GET` or `POST`.

        :returns: The updated WebhookInstance
        r2   N)r,   update_asyncr4   r   r   r   r6   r   s   zWebhookInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z+WebhookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Conversations.V1.WebhookInstance {}>joinr"   itemsr=   r$   contextr   r   r   __repr__      
zWebhookInstance.__repr__)r'   r(   )r'   r   )r   r   r   objectr   r   r   strr   r    propertyr,   r.   r0   r   unsetr   r   r3   r6   rI   __classcell__r   r   r%   r   r      sZ    



	







r   c                       s   e Zd Zdedef fddZdefddZdefdd	Ze	j
e	j
e	j
e	j
fd
eeef deeef deee ef deeef def
ddZe	j
e	j
e	j
e	j
fd
eeef deeef deee ef deeef def
ddZdefddZ  ZS )r(   r   r   c                    s.   t  | d|i| _djdi | j| _dS )a  
        Initialize the WebhookContext

        :param 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.
        r   z3/Services/{chat_service_sid}/Configuration/WebhooksNr   )r   r    r"   r=   _urir$   r   r   r%   r   r   r       s   zWebhookContext.__init__r'   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r-   application/jsonAcceptr   r   uriheadersr   r)   )r   ofr*   r.   rP   r   r"   r$   rV   r   r   r   r   r.      s   
zWebhookContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r/   rR   rS   r   rT   Nr   r)   )r   rW   r*   r0   rP   r   r"   rX   r   r   r   r0      s   
zWebhookContext.fetch_asyncr   r   r   r   c              	   C   sf   t ||t|dd |d}t i }d|d< d|d< | jjd| j||d	}t| j|| jd
 dS )r1   c                 S      | S Nr   er   r   r   <lambda>       z'WebhookContext.update.<locals>.<lambda>PreWebhookUrlPostWebhookUrlFiltersr   !application/x-www-form-urlencodedContent-TyperR   rS   r   r   rU   datarV   r   r)   )	r   rW   r   mapr*   r3   rP   r   r"   r$   r   r   r   r   rf   rV   r   r   r   r   r3      s    

zWebhookContext.updatec              	      sn   t ||t|dd |d}t i }d|d< d|d< | jjd| j||d	I d
H }t| j|| jd dS )r5   c                 S   rY   rZ   r   r[   r   r   r   r]     r^   z-WebhookContext.update_async.<locals>.<lambda>r_   rc   rd   rR   rS   r   re   Nr   r)   )	r   rW   r   rg   r*   r6   rP   r   r"   rh   r   r   r   r6      s"   

zWebhookContext.update_asyncc                 C   r7   )r8   r9   c                 s   r:   r;   r<   r>   r   r   r   rB   '  rC   z*WebhookContext.__repr__.<locals>.<genexpr>z+<Twilio.Conversations.V1.WebhookContext {}>rD   rG   r   r   r   rI   !  rJ   zWebhookContext.__repr__)r   r   r   r   rL   r    r   r.   r0   r   rN   r   rK   r   r3   r6   rI   rO   r   r   r%   r   r(      sF    



*



(r(   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )WebhookListr   r   c                    s   t  | d|i| _dS )a  
        Initialize the WebhookList

        :param 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.

        r   N)r   r    r"   rQ   r%   r   r   r    -  s   
zWebhookList.__init__r'   c                 C      t | j| jd dS z.
        Constructs a WebhookContext

        r   r)   r(   r*   r"   r+   r   r   r   r!   <     zWebhookList.getc                 C   rj   rk   rl   r+   r   r   r   __call__E  rm   zWebhookList.__call__c                 C   s   dS )r8   z%<Twilio.Conversations.V1.WebhookList>r   r+   r   r   r   rI   N  s   zWebhookList.__repr__)r   r   r   r   rL   r    r(   r!   rn   rI   rO   r   r   r%   r   ri   +  s
    		ri   N)__doc__typingr   r   r   r   r   twilio.baser   r   twilio.base.instance_contextr	   twilio.base.instance_resourcer
   twilio.base.list_resourcer   twilio.base.versionr   r   r(   ri   r   r   r   r   <module>   s    } 