U
    ^g%i7                     @   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eeeef ed fddZ	e
dddd	Zd dd
dZd dddZejejejejfeeef eeef eee ef eeef d dddZejejejejfeeef eeef eee ef eeef d dddZed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   y/var/www/html/api-medvista/venv/lib/python3.8/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__WebhookContextreturnc                 C   s&   | j dk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   r1   Q   s    zWebhookInstance.fetch_asyncr   r   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   r5   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
        r4   N)r-   update_asyncr6   r   r   r   r8   r   s    zWebhookInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>   s     z+WebhookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Conversations.V1.WebhookInstance {}>joinr"   itemsr=   r$   contextr   r   r   __repr__   s    zWebhookInstance.__repr__)r   r   r   objectr   r   r   strr   r    propertyr-   r/   r1   r   unsetr   r   r5   r8   rH   __classcell__r   r   r%   r   r      s@    
 	





r   c                       s   e Zd Zeed fddZedddZedddZe	j
e	j
e	j
e	j
feeef eeef eee ef eeef ed	d
dZe	j
e	j
e	j
e	j
feeef eeef eee ef eeef ed	ddZedddZ  ZS )r'   r   r   c                    s*   t  | d|i| _djf | 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/WebhooksN)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/   rO   r   r"   r$   rU   r   r   r   r   r/      s    
zWebhookContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r0   rQ   rR   r   rS   Nr   r*   )r   rV   r+   r1   rO   r   r"   rW   r   r   r   r1      s    
  zWebhookContext.fetch_asyncr2   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 )r3   c                 S   s   | S Nr   er   r   r   <lambda>       z'WebhookContext.update.<locals>.<lambda>ZPreWebhookUrlZPostWebhookUrlZFiltersr   !application/x-www-form-urlencodedContent-TyperQ   rR   r   r   rT   datarU   r   r*   )	r   rV   r   mapr+   r5   rO   r   r"   r$   r   r   r   r   ra   rU   r   r   r   r   r5      s*    
     zWebhookContext.updatec              	      sl   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 )r7   c                 S   s   | S rX   r   rY   r   r   r   r[     r\   z-WebhookContext.update_async.<locals>.<lambda>r]   r^   r_   rQ   rR   r   r`   Nr   r*   )	r   rV   r   rb   r+   r8   rO   r   r"   rc   r   r   r   r8      s*    
     zWebhookContext.update_asyncc                 C   s$   d dd | j D }d|S )r9   r:   c                 s   s   | ]\}}d  ||V  qdS r;   r<   r>   r   r   r   rB   '  s     z*WebhookContext.__repr__.<locals>.<genexpr>z+<Twilio.Conversations.V1.WebhookContext {}>rC   rF   r   r   r   rH   !  s    zWebhookContext.__repr__)r   r   r   r   rJ   r    r   r/   r1   r   rL   r   rI   r   r5   r8   rH   rM   r   r   r%   r   r'      s4   


*


(r'   c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )WebhookListrN   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"   rP   r%   r   r   r    -  s     zWebhookList.__init__r(   c                 C   s   t | j| jd dS z.
        Constructs a WebhookContext

        r   r*   r'   r+   r"   r,   r   r   r   r!   <  s     zWebhookList.getc                 C   s   t | j| jd dS re   rf   r,   r   r   r   __call__E  s     zWebhookList.__call__c                 C   s   dS )r9   z%<Twilio.Conversations.V1.WebhookList>r   r,   r   r   r   rH   N  s    zWebhookList.__repr__)r   r   r   r   rJ   r    r'   r!   rg   rH   rM   r   r   r%   r   rd   +  s   		rd   N)__doc__typingr   r   r   r   r   Ztwilio.baser   r   Ztwilio.base.instance_contextr	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r'   rd   r   r   r   r   <module>   s   } 