o
    f>h3                     @   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                       sH  e Zd ZG dd deZG dd deZ	 dedeee	f 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ejfdeeef deee ef deeef deeef dedef d	d fddZejejejejejfdeeef deee ef deeef deeef dedef d	d fddZd	efddZ  ZS )WebhookInstancec                   @      e Zd ZdZdZdS )zWebhookInstance.MethodGETPOSTN)__name__
__module____qualname__r   r    r   r   e/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/configuration/webhook.pyMethod       r   c                   @   r   )WebhookInstance.TargetwebhookflexN)r   r   r   WEBHOOKFLEXr   r   r   r   Target   r   r   versionpayloadc                    sj   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	d | _
d S )Naccount_sidmethodfilterspre_webhook_urlpost_webhook_urltargeturl)super__init__getr    r!   r"   r#   r$   r%   r&   _context)selfr   r   	__class__r   r   r(   +   s   
zWebhookInstance.__init__returnWebhookContextc                 C   s   | j du rt| j| _ | 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
        N)r*   r/   _versionr+   r   r   r   _proxy8   s
   
zWebhookInstance._proxyc                 C   s
   | j  S )[
        Fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        )r2   fetchr1   r   r   r   r4   F   s   
zWebhookInstance.fetchc                    s   | j  I dH S )u
        Asynchronous coroutine to fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        N)r2   fetch_asyncr1   r   r   r   r6   O   s   zWebhookInstance.fetch_asyncr!   r"   r#   r$   r%   r   c                 C   s   | j j|||||dS )  
        Update the WebhookInstance

        :param method: The HTTP method to be used when sending a webhook request.
        :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated`
        :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 target:

        :returns: The updated WebhookInstance
        r!   r"   r#   r$   r%   )r2   updater+   r!   r"   r#   r$   r%   r   r   r   r9   X   s   zWebhookInstance.updatec                    s   | j j|||||dI dH S )  
        Asynchronous coroutine to update the WebhookInstance

        :param method: The HTTP method to be used when sending a webhook request.
        :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated`
        :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 target:

        :returns: The updated WebhookInstance
        r8   N)r2   update_asyncr:   r   r   r   r<   s   s   zWebhookInstance.update_asyncc                 C      dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z)<Twilio.Conversations.V1.WebhookInstance>r   r1   r   r   r   __repr__      zWebhookInstance.__repr__)r.   r/   )r.   r   )r   r   r   objectr   r   r   r   strr   r(   propertyr2   r4   r6   r   unsetr   r   r9   r<   r?   __classcell__r   r   r,   r   r      s\    


	









r   c                       s  e Zd Z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	ej	fd	e
eef d
e
ee ef de
eef de
eef de
def defddZej	ej	ej	ej	ej	fd	e
eef d
e
ee ef de
eef de
eef de
def defddZdefddZ  ZS )r/   r   c                    s   t  | d| _dS )zk
        Initialize the WebhookContext

        :param version: Version that contains the resource
        z/Configuration/WebhooksN)r'   r(   _urir+   r   r,   r   r   r(      s   
zWebhookContext.__init__r.   c                 C   s2   t i }d|d< | jjd| j|d}t| j|S )r3   application/jsonAcceptr   r!   uriheaders)r   ofr0   r4   rF   r   r+   rL   r   r   r   r   r4      s   
zWebhookContext.fetchc                    s:   t i }d|d< | jjd| j|dI dH }t| j|S )r5   rH   rI   r   rJ   N)r   rM   r0   r6   rF   r   rN   r   r   r   r6      s   
zWebhookContext.fetch_asyncr!   r"   r#   r$   r%   r   c           	      C   s^   t |t|dd |||d}t i }d|d< d|d< | jjd| j||d	}t| j|S )
r7   c                 S      | S Nr   er   r   r   <lambda>       z'WebhookContext.update.<locals>.<lambda>r   FiltersPreWebhookUrlPostWebhookUrlr   !application/x-www-form-urlencodedContent-TyperH   rI   r   r!   rK   datarL   )r   rM   r   mapr0   r9   rF   r   	r+   r!   r"   r#   r$   r%   r\   rL   r   r   r   r   r9      s   
	
zWebhookContext.updatec           	         sf   t |t|dd |||d}t i }d|d< d|d< | jjd| j||d	I d
H }t| j|S )r;   c                 S   rO   rP   r   rQ   r   r   r   rS     rT   z-WebhookContext.update_async.<locals>.<lambda>rU   rY   rZ   rH   rI   r   r[   N)r   rM   r   r]   r0   r<   rF   r   r^   r   r   r   r<      s    
	
zWebhookContext.update_asyncc                 C   r=   )r>   z(<Twilio.Conversations.V1.WebhookContext>r   r1   r   r   r   r?     r@   zWebhookContext.__repr__)r   r   r   r   r(   r   r4   r6   r   rD   r   rB   rA   r   r9   r<   r?   rE   r   r   r,   r   r/      sR    





+




)r/   c                       sL   e Zd Z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   c                    s   t  | dS )zi
        Initialize the WebhookList

        :param version: Version that contains the resource

        N)r'   r(   rG   r,   r   r   r(   *  s   zWebhookList.__init__r.   c                 C   
   t | jS z.
        Constructs a WebhookContext

        r/   r0   r1   r   r   r   r)   3     
zWebhookList.getc                 C   r`   ra   rb   r1   r   r   r   __call__:  rc   zWebhookList.__call__c                 C   r=   )r>   z%<Twilio.Conversations.V1.WebhookList>r   r1   r   r   r   r?   A  s   zWebhookList.__repr__)r   r   r   r   r(   r/   r)   rd   rB   r?   rE   r   r   r,   r   r_   (  s
    	r_   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/   r_   r   r   r   r   <module>   s      