
    i?1ip                         d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZmZ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e      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.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                   X    e Zd Z G d de      Z G d de      Z	 	 ddedeee	f   deded	e
e   f
 fd
Zedd       ZdefdZdefdZddZddZej(                  ej(                  ej(                  ej(                  ej(                  fdeeef   dedef   de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(                  ej(                  fdeeef   dedef   de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        /home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/twilio/rest/conversations/v1/service/conversation/webhook.pyMethodr      s    r   r   c                       e Zd ZdZdZdZy)WebhookInstance.TargetwebhooktriggerstudioN)r   r   r   WEBHOOKTRIGGERSTUDIOr   r   r   Targetr!      s    r   r(   versionpayloadchat_service_sidconversation_sidsidc                 <   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        t        j                  |j                  d            | _        t        j                  |j                  d	            | _        |||xs | j                  d
| _        d | _        y )Nr-   account_sidr+   r,   targeturlconfigurationdate_createddate_updatedr+   r,   r-   )super__init__getr-   r/   r+   r,   r0   r1   r2   r   iso8601_datetimer3   r4   	_solution_context)selfr)   r*   r+   r,   r-   	__class__s         r   r7   zWebhookInstance.__init__0   s     	!")++e"4*1++m*D/6{{;M/N/6{{;M/N%,[[%:")++e"4:A++o:V0;0L0LKK'1
 1<0L0LKK'1

 !1 0?$((

 37r   returnc                     | j                   Et        | j                  | j                  d   | j                  d   | 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-   r5   )r;   WebhookContext_versionr:   r<   s    r   _proxyzWebhookInstance._proxyO   sS     == *!%0B!C!%0B!CNN5)	DM }}r   c                 6    | j                   j                         S )j
        Deletes the WebhookInstance


        :returns: True if delete succeeds, False otherwise
        )rC   deleterB   s    r   rF   zWebhookInstance.delete`   s     {{!!##r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the WebhookInstance


        :returns: True if delete succeeds, False otherwise
        N)rC   delete_asyncrB   s    r   rI   zWebhookInstance.delete_asynci   s!      [[--////   '%'c                 6    | j                   j                         S )[
        Fetch the WebhookInstance


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


        :returns: The fetched WebhookInstance
        N)rC   fetch_asyncrB   s    r   rP   zWebhookInstance.fetch_async{   s!      [[,,....rJ   configuration_urlconfiguration_methodr   configuration_filtersconfiguration_triggersconfiguration_flow_sidc                 B    | j                   j                  |||||      S )  
        Update the WebhookInstance

        :param configuration_url: The absolute url the webhook request should be sent to.
        :param configuration_method:
        :param configuration_filters: The list of events, firing webhook event for this Conversation.
        :param configuration_triggers: The list of keywords, firing webhook event for this Conversation.
        :param configuration_flow_sid: The studio flow SID, where the webhook should be sent to.

        :returns: The updated WebhookInstance
        rQ   rR   rS   rT   rU   )rC   updater<   rQ   rR   rS   rT   rU   s         r   rY   zWebhookInstance.update   s/    & {{!!/!5"7#9#9 " 
 	
r   c                 ^   K   | j                   j                  |||||       d{   S 7 w)%  
        Asynchronous coroutine to update the WebhookInstance

        :param configuration_url: The absolute url the webhook request should be sent to.
        :param configuration_method:
        :param configuration_filters: The list of events, firing webhook event for this Conversation.
        :param configuration_triggers: The list of keywords, firing webhook event for this Conversation.
        :param configuration_flow_sid: The studio flow SID, where the webhook should be sent to.

        :returns: The updated WebhookInstance
        rX   N)rC   update_asyncrZ   s         r   r]   zWebhookInstance.update_async   s=     & [[--/!5"7#9#9 . 
 
 	
 
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:   itemsrd   r<   contexts     r   __repr__zWebhookInstance.__repr__   s6     ((SDNN<P<P<RSS=DDWMMr   N)r>   r@   )r>   r   )r   r   r   objectr   r(   r   r   strr   r   r7   propertyrC   boolrF   rI   rM   rP   r   unsetr   r   rY   r]   rq   __classcell__r=   s   @r   r   r      s     

$ "77 c3h7 	7
 7 c]7>   $ $0D 0#/ 17HN:@,,;A<<5;\\
 f-
 $$<f$DE
  %T#Y%67	

 !&d3i&7 8
 !&c6k 2
 

: 17HN:@,,;A<<5;\\
 f-
 $$<f$DE
  %T#Y%67	

 !&d3i&7 8
 !&c6k 2
 

6N# Nr   r   c                       e Zd Zdedededef fdZdefdZdefdZde	fd	Z
de	fd
Zej                  ej                  ej                  ej                  ej                  fdeeef   dedef   de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                  ej                  fdeeef   dedef   de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+   r,   r-   c                 |    t         |   |       |||d| _         dj                  di | j                  | _        y)a  
        Initialize the WebhookContext

        :param version: Version that contains the resource
        :param chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with.
        :param conversation_sid: The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.
        :param sid: A 34 character string that uniquely identifies this resource.
        r5   zL/Services/{chat_service_sid}/Conversations/{conversation_sid}/Webhooks/{sid}Nr   r6   r7   r:   rd   _uri)r<   r)   r+   r,   r-   r=   s        r   r7   zWebhookContext.__init__   sJ     	! !1 0

 jbii 
nn
	r   r>   c                 P    | j                   j                  d| j                        S )rE   DELETEmethoduri)rA   rF   r}   rB   s    r   rF   zWebhookContext.delete   s*     }}##		 $ 
 	
r   c                 l   K   | j                   j                  d| j                         d{   S 7 w)rH   r   r   N)rA   rI   r}   rB   s    r   rI   zWebhookContext.delete_async   s8      ]]//		 0 
 
 	
 
s   +424c                     | j                   j                  d| j                        }t        | j                   || j                  d   | j                  d   | j                  d         S )rL   r   r   r+   r,   r-   r5   )rA   rM   r}   r   r:   r<   r*   s     r   rM   zWebhookContext.fetch   sf     --%%		 & 

 MM!^^,>?!^^,>?u%
 	
r   c                    K   | j                   j                  d| j                         d{   }t        | j                   || j                  d   | j                  d   | j                  d         S 7 Ew)rO   r   r   Nr+   r,   r-   r5   )rA   rP   r}   r   r:   r   s     r   rP   zWebhookContext.fetch_async	  st      11		 2 
 

 MM!^^,>?!^^,>?u%
 	

s   +A5A3AA5rQ   rR   r   rS   rT   rU   c           	      ^   t        j                  ||t        j                  |d       t        j                  |d       |d      }| j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d   | j                  d   	      S )
rW   c                     | S rr   r   es    r   <lambda>z'WebhookContext.update.<locals>.<lambda>6      Q r   c                     | S rr   r   r   s    r   r   z'WebhookContext.update.<locals>.<lambda>9      a r   Configuration.UrlConfiguration.MethodConfiguration.FiltersConfiguration.TriggersConfiguration.FlowSidr   r   r   datar+   r,   r-   r5   )	r   ofr   maprA   rY   r}   r   r:   r<   rQ   rR   rS   rT   rU   r   r*   s           r   rY   zWebhookContext.update  s    & yy%6(<)2);* +4--*K+ *@

 --&&		 ' 
 MM!^^,>?!^^,>?u%
 	
r   c           	      z  K   t        j                  ||t        j                  |d       t        j                  |d       |d      }| j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d   | j                  d	   
      S 7 Ew)r\   c                     | S rr   r   r   s    r   r   z-WebhookContext.update_async.<locals>.<lambda>e  r   r   c                     | S rr   r   r   s    r   r   z-WebhookContext.update_async.<locals>.<lambda>h  r   r   r   r   r   Nr+   r,   r-   r5   )	r   r   r   r   rA   r]   r}   r   r:   r   s           r   r]   zWebhookContext.update_asyncM  s     & yy%6(<)2);* +4--*K+ *@

 22		 3 
 
 MM!^^,>?!^^,>?u%
 	

s   A1B;3B94AB;c                     dj                  d | j                  j                         D              }dj                  |      S )r_   r`   c              3   F   K   | ]  \  }}d j                  ||        ywrb   rc   re   s      r   ri   z*WebhookContext.__repr__.<locals>.<genexpr>  rj   rk   z+<Twilio.Conversations.V1.WebhookContext {}>rl   ro   s     r   rq   zWebhookContext.__repr__|  s6     ((SDNN<P<P<RSS<CCGLLr   )r   r   r   r   rt   r7   rv   rF   rI   r   rM   rP   r   rw   r   rs   r   rY   r]   rq   rx   ry   s   @r   r@   r@      s   

25
IL
SV
.

 



D 


 
*
? 
. 17HN:@,,;A<<5;\\-
 f--
 $$<f$DE-
  %T#Y%67	-

 !&d3i&7 8-
 !&c6k 2-
 
-
b 17HN:@,,;A<<5;\\-
 f--
 $$<f$DE-
  %T#Y%67	-

 !&d3i&7 8-
 !&c6k 2-
 
-
^M# Mr   r@   c                   2    e Zd Zdeeef   defdZdefdZy)WebhookPager*   r>   c                 h    t        | j                  || j                  d   | j                  d         S )zm
        Build an instance of WebhookInstance

        :param payload: Payload response from the API
        r+   r,   r+   r,   )r   rA   r:   r   s     r   get_instancezWebhookPage.get_instance  s5     MM!^^,>?!^^,>?	
 	
r   c                      y)r_   z%<Twilio.Conversations.V1.WebhookPage>r   rB   s    r   rq   zWebhookPage.__repr__       7r   N)	r   r   r   r   rt   r   r   r   rq   r   r   r   r   r     s)    
DcN 
 
7# 7r   r   c                       e Zd Zdededef fdZej                  ej                  ej                  ej                  ej                  ej                  fdddeee	f   ded	e	f   d
ee
e   e	f   dee
e   e	f   deee	f   deee	f   defdZej                  ej                  ej                  ej                  ej                  ej                  fdddeee	f   ded	e	f   d
ee
e   e	f   dee
e   e	f   deee	f   deee	f   defdZ	 	 d"dee   dee   dee   fdZ	 	 d"dee   dee   dee   fdZ	 	 d"dee   dee   de
e   fdZ	 	 d"dee   dee   de
e   fdZej                  ej                  ej                  fdeee	f   deee	f   deee	f   defdZej                  ej                  ej                  fdeee	f   deee	f   deee	f   defdZdedefdZdedefdZdedefdZdedefd Zdefd!Z xZS )#WebhookListr)   r+   r,   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a  
        Initialize the WebhookList

        :param version: Version that contains the resource
        :param chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with.
        :param conversation_sid: The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook.

        r   zF/Services/{chat_service_sid}/Conversations/{conversation_sid}/WebhooksNr   r|   )r<   r)   r+   r,   r=   s       r   r7   zWebhookList.__init__  sG     	! !1 0
 d\cc 
nn
	r   r0   r!   rQ   rR   r   rS   rT   rU   configuration_replay_afterr>   c           
      F   t        j                  |||t        j                  |d       t        j                  |d       ||d      }| j                  j                  d| j                  |      }	t        | j                  |	| j                  d   | j                  d         S )	a  
        Create the WebhookInstance

        :param target:
        :param configuration_url: The absolute url the webhook request should be sent to.
        :param configuration_method:
        :param configuration_filters: The list of events, firing webhook event for this Conversation.
        :param configuration_triggers: The list of keywords, firing webhook event for this Conversation.
        :param configuration_flow_sid: The studio flow SID, where the webhook should be sent to.
        :param configuration_replay_after: The message index for which and it's successors the webhook will be replayed. Not set by default

        :returns: The created WebhookInstance
        c                     | S rr   r   r   s    r   r   z$WebhookList.create.<locals>.<lambda>  r   r   c                     | S rr   r   r   s    r   r   z$WebhookList.create.<locals>.<lambda>  r   r   r(   r   r   r   r   r   zConfiguration.ReplayAfterr   r   r+   r,   r   )	r   r   r   r   rA   creater}   r   r:   
r<   r0   rQ   rR   rS   rT   rU   r   r   r*   s
             r   r   zWebhookList.create  s    . yy %6(<)2);* +4--*K+ *@-G
  --&&		 ' 
 MM!^^,>?!^^,>?	
 	
r   c           
      b  K   t        j                  |||t        j                  |d       t        j                  |d       ||d      }| j                  j                  d| j                  |       d{   }	t        | j                  |	| j                  d   | j                  d   	      S 7 7w)
a  
        Asynchronously create the WebhookInstance

        :param target:
        :param configuration_url: The absolute url the webhook request should be sent to.
        :param configuration_method:
        :param configuration_filters: The list of events, firing webhook event for this Conversation.
        :param configuration_triggers: The list of keywords, firing webhook event for this Conversation.
        :param configuration_flow_sid: The studio flow SID, where the webhook should be sent to.
        :param configuration_replay_after: The message index for which and it's successors the webhook will be replayed. Not set by default

        :returns: The created WebhookInstance
        c                     | S rr   r   r   s    r   r   z*WebhookList.create_async.<locals>.<lambda>  r   r   c                     | S rr   r   r   s    r   r   z*WebhookList.create_async.<locals>.<lambda>  r   r   r   r   r   Nr+   r,   r   )	r   r   r   r   rA   create_asyncr}   r   r:   r   s
             r   r   zWebhookList.create_async  s     . yy %6(<)2);* +4--*K+ *@-G
  22		 3 
 
 MM!^^,>?!^^,>?	
 	

s   A3B/5B-68B/limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a]  
        Streams WebhookInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r   r   r   )rA   read_limitspagestreamr<   r   r   limitsr   s        r   r   zWebhookList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)al  
        Asynchronously streams WebhookInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, stream() will attempt to read the
                          limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        r   r   Nr   )rA   r   
page_asyncstream_asyncr   s        r   r   zWebhookList.stream_async3  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists WebhookInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        r   r   )listr   )r<   r   r   s      r   r   zWebhookList.listL  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a	  
        Asynchronously lists WebhookInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param page_size: Number of records to fetch per request, when not set will use
                          the default value of 50 records.  If no page_size is defined
                          but a limit is defined, list() will attempt to read the limit
                          with the most efficient page size, i.e. min(limit, 1000)

        :returns: list that will contain up to limit results
        r   N)r   )r<   r   r   records       r   
list_asynczWebhookList.list_asyncf  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }| j                  j                  d| j                  |      }t        | j                  || j                        S )as  
        Retrieve a single page of WebhookInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of WebhookInstance
        	PageTokenr   PageSizer   r   r   params)r   r   rA   r   r}   r   r:   r<   r   r   r   r   responses         r   r   zWebhookList.page  sX      yy'#%
 ==%%U		$%O4==(DNNCCr   c                    K   t        j                  |||d      }| j                  j                  d| j                  |       d{   }t        | j                  || j                        S 7 %w)a  
        Asynchronously retrieve a single page of WebhookInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of WebhookInstance
        r   r   r   N)r   r   rA   r   r}   r   r:   r   s         r   r   zWebhookList.page_async  sm       yy'#%
 11dii 2 
 
 4==(DNNCC
s   AA/A-&A/
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of WebhookInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of WebhookInstance
        r   )rA   domaintwiliorequestr   r:   r<   r   r   s      r   get_pagezWebhookList.get_page  s=     ==''..66ujI4==(DNNCCr   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of WebhookInstance records from the API.
        Request is executed immediately

        :param target_url: API-generated URL for the requested results page

        :returns: Page of WebhookInstance
        r   N)rA   r   r   request_asyncr   r:   r   s      r   get_page_asynczWebhookList.get_page_async  sJ      --44BB5*UU4==(DNNCC Vs   4AA&Ar-   c                 h    t        | j                  | j                  d   | j                  d   |      S z
        Constructs a WebhookContext

        :param sid: A 34 character string that uniquely identifies this resource.
        r+   r,   r5   r@   rA   r:   r<   r-   s     r   r8   zWebhookList.get  5     MM!^^,>?!^^,>?	
 	
r   c                 h    t        | j                  | j                  d   | j                  d   |      S r   r   r   s     r   __call__zWebhookList.__call__  r   r   c                      y)r_   z%<Twilio.Conversations.V1.WebhookList>r   rB   s    r   rq   zWebhookList.__repr__  r   r   )NN) r   r   r   r   rt   r7   r   rw   r   rs   r   intr   r   r   r   r	   r   r
   r   r   r   r   r   r   r   r   r@   r8   r   rq   rx   ry   s   @r   r   r     s   
 
3 
RU 
. 17HN:@,,;A<<5;\\9?2
(2
 !f-2
 $$<f$DE	2

  %T#Y%672
 !&d3i&7 82
 !&c6k 22
 %*#v+$62
 
2
n 17HN:@,,;A<<5;\\9?2
(2
 !f-2
 $$<f$DE	2

  %T#Y%672
 !&d3i&7 82
 !&c6k 22
 %*#v+$62
 
2
l  $#';}; C=; 
/	"	;6  $#'A}A C=A 
	'	A6  $#'
}
 C=
 
o		
8  $#'
}
 C=
 
o		
: *0*0,,(.	D#v+&D 3;'D f%	D
 
D: *0*0,,(.	D#v+&D 3;'D f%	D
 
D:
D3 
D; 
D
Ds 
D{ 
D
s 
~ 

C 
N 
7# 7r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r@   r   r   r   r   r   <module>r      sj     L L L 6 6 8 : 2 ' !gN& gNTM_ MD7$ 7.T7, T7r   