
    pi7                         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	e      Z G d
 de      Z G d de      Zy)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                       e Zd Z G d de      Z	 dedeeef   def fdZ	e
dd       Zdd	Z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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ZdefdZ xZS )WebhookInstancec                       e Zd ZdZdZy)WebhookInstance.MethodGETPOSTN)__name__
__module____qualname__r   r        |/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/conversations/v1/service/configuration/webhook.pyMethodr      s    r   r   versionpayloadchat_service_sidc                 x   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        d|i| _
        d | _        y )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__s       r   r&   zWebhookInstance.__init__'   s     	!*1++m*D/6{{;M/N.5kk:K.L/6{{;M/N,3KK	,B:A++h:O")++e"4  0
 37r   returnc                     | j                   )t        | j                  | j                  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
        r   r   )r)   WebhookContext_versionr(   r*   s    r   _proxyzWebhookInstance._proxy9   s:     == *!%0B!CDM }}r   c                 6    | j                   j                         S )[
        Fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        )r2   fetchr1   s    r   r5   zWebhookInstance.fetchH   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)u
        Asynchronous coroutine to fetch the WebhookInstance


        :returns: The fetched WebhookInstance
        N)r2   fetch_asyncr1   s    r   r8   zWebhookInstance.fetch_asyncQ   s!      [[,,....s   '%'r    r!   r"   r#   c                 @    | j                   j                  ||||      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#   )r2   updater*   r    r!   r"   r#   s        r   r<   zWebhookInstance.updateZ   s,    " {{!!+-	 " 
 	
r   c                 \   K   | j                   j                  ||||       d{   S 7 w)  
        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
        r;   N)r2   update_asyncr=   s        r   r@   zWebhookInstance.update_asyncr   s:     " [[--+-	 . 
 
 	
 
s   #,*,c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r   	<genexpr>z+WebhookInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z,<Twilio.Conversations.V1.WebhookInstance {}>joinr(   itemsrG   r*   contexts     r   __repr__zWebhookInstance.__repr__   s6     ((SDNN<P<P<RSS=DDWMMr   )r,   r/   )r,   r   )r   r   r   objectr   r   r   strr   r&   propertyr2   r5   r8   r	   unsetr   r   r<   r@   rT   __classcell__r+   s   @r   r   r      s]    77)-c3h7KN7$  #/ /5ll/5||,2LL%+\\
sF{+
  V,
 tCy&()	

 c6k"
 

4 /5ll/5||,2LL%+\\
sF{+
  V,
 tCy&()	

 c6k"
 

0N# Nr   r   c                       e Zd Zdedef fdZdefdZdef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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ZdefdZ xZS )r/   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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(   rG   _urir*   r   r   r+   s      r   r&   zWebhookContext.__init__   sG     	!  0
 QIPP 
nn
	r   r,   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )r4   application/jsonAcceptr   r#   uriheadersr   r.   )r	   ofr0   r5   r]   r   r(   r*   rd   r   s      r   r5   zWebhookContext.fetch   s^     ))B-.--%%U		7%SMM!^^,>?
 	
r   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)r7   r`   ra   r   rb   Nr   r.   )r	   re   r0   r8   r]   r   r(   rf   s      r   r8   zWebhookContext.fetch_async   ss      ))B-.11dii 2 
 
 MM!^^,>?
 	
	
s   AA4A2	*A4r    r!   r"   r#   c                 :   t        j                  ||t        j                  |d       |d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d	   
      S )r:   c                     | S Nr   es    r   <lambda>z'WebhookContext.update.<locals>.<lambda>       A r   PreWebhookUrlPostWebhookUrlFiltersr   !application/x-www-form-urlencodedContent-Typer`   ra   r   r#   rc   datard   r   r.   )	r	   re   r   mapr0   r<   r]   r   r(   r*   r    r!   r"   r#   rv   rd   r   s           r   r<   zWebhookContext.update   s    $ yy!0"2$==+> 	
 ))B-"E.--&&tyytW ' 
 MM7T^^DV5W
 	
r   c                 V  K   t        j                  ||t        j                  |d       |d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  || j                  d
         S 7 )w)r?   c                     | S rj   r   rk   s    r   rm   z-WebhookContext.update_async.<locals>.<lambda>  rn   r   ro   rs   rt   r`   ra   r   ru   Nr   r.   )	r	   re   r   rw   r0   r@   r]   r   r(   rx   s           r   r@   zWebhookContext.update_async   s     $ yy!0"2$==+> 	
 ))B-"E.22tyytW 3 
 
 MM7T^^DV5W
 	
	
s   A;B)=B'>*B)c                     dj                  d | j                  j                         D              }dj                  |      S )rB   rC   c              3   F   K   | ]  \  }}d j                  ||        ywrE   rF   rH   s      r   rL   z*WebhookContext.__repr__.<locals>.<genexpr>'  rM   rN   z+<Twilio.Conversations.V1.WebhookContext {}>rO   rR   s     r   rT   zWebhookContext.__repr__!  s6     ((SDNN<P<P<RSS<CCGLLr   )r   r   r   r   rV   r&   r   r5   r8   r	   rX   r   rU   r   r<   r@   rT   rY   rZ   s   @r   r/   r/      s6   
 
3 
"
 
(
? 
0 /5ll/5||,2LL%+\\&
sF{+&
  V,&
 tCy&()	&

 c6k"&
 
&
T /5ll/5||,2LL%+\\&
sF{+&
  V,&
 tCy&()	&

 c6k"&
 
&
PM# Mr   r/   c                   L     e Zd Zdedef fdZdefdZdefdZdefdZ	 xZ
S )WebhookListr   r   c                 6    t         |   |       d|i| _        y)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(   r^   s      r   r&   zWebhookList.__init__-  s#     	!  0
r   r,   c                 J    t        | j                  | j                  d         S z.
        Constructs a WebhookContext

        r   r.   r/   r0   r(   r1   s    r   r'   zWebhookList.get<  $    
 MMDNN;M,N
 	
r   c                 J    t        | j                  | j                  d         S r   r   r1   s    r   __call__zWebhookList.__call__E  r   r   c                      y)rB   z%<Twilio.Conversations.V1.WebhookList>r   r1   s    r   rT   zWebhookList.__repr__N  s     7r   )r   r   r   r   rV   r&   r/   r'   r   rT   rY   rZ   s   @r   r~   r~   +  s:    
 
3 

^ 

. 
7# 7r   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   <module>r      sP    4 3 ) 8 : 2 'zN& zNzTM_ TMn)7, )7r   