
    piT                         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 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 - Proxy
    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values)InstanceContext)InstanceResource)ListResource)Version)Pagec                        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defdZ xZS )InteractionInstancec                   `    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZy)"InteractionInstance.ResourceStatusacceptedansweredbusycanceled	completeddeleted	deliveredzdelivery-unknownfailedzin-progress	initiatedz	no-answerqueuedreceived	receivingringing	scheduledsendingsentundeliveredunknownN)__name__
__module____qualname__ACCEPTEDANSWEREDBUSYCANCELED	COMPLETEDDELETED	DELIVEREDDELIVERY_UNKNOWNFAILEDIN_PROGRESS	INITIATED	NO_ANSWERQUEUEDRECEIVED	RECEIVINGRINGING	SCHEDULEDSENDINGSENTUNDELIVEREDUNKNOWN     r/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/proxy/v1/service/session/interaction.pyResourceStatusr      sl    		-#				#rA   rC   c                       e Zd ZdZdZdZy)InteractionInstance.Typemessagevoicer'   N)r(   r)   r*   MESSAGEVOICEr?   r@   rA   rB   TyperE   2   s    rA   rJ   versionpayloadservice_sidsession_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t'        j(                  |j                  d            | _        t'        j(                  |j                  d            | _        |j                  d      | _        |||xs | j                  d| _        d | _        y )NrO   rN   rM   account_siddatatypeinbound_participant_sidinbound_resource_sidinbound_resource_statusinbound_resource_typeinbound_resource_urloutbound_participant_sidoutbound_resource_sidoutbound_resource_statusoutbound_resource_typeoutbound_resource_urldate_createddate_updatedurlrM   rN   rO   )super__init__getrO   rN   rM   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r   iso8601_datetimer^   r_   r`   	_solution_context)selfrK   rL   rM   rN   rO   	__class__s         rB   rc   zInteractionInstance.__init__M   s    	!")++e"4*1++m*D*1++m*D*1++m*D#*;;v#6	:A++f:M	6=kk%7
$ 4;;;?U3V!KK12 	$ 5<KK@W4X"3:;;?U3V!7>{{&8
% 5<KK@W4X" KK23 	% 6=[[$6
# 5<KK@W4X"0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 '&?$((

 7;rA   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: InteractionContext for this InteractionInstance
        rM   rN   rO   ra   )rg   InteractionContext_versionrf   rh   s    rB   _proxyzInteractionInstance._proxy   sQ     == . NN=9 NN=9NN5)	DM }}rA   c                 6    | j                   j                         S )n
        Deletes the InteractionInstance


        :returns: True if delete succeeds, False otherwise
        )ro   deletern   s    rB   rr   zInteractionInstance.delete   s     {{!!##rA   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the InteractionInstance


        :returns: True if delete succeeds, False otherwise
        N)ro   delete_asyncrn   s    rB   ru   z InteractionInstance.delete_async   s!      [[--////   '%'c                 6    | j                   j                         S )c
        Fetch the InteractionInstance


        :returns: The fetched InteractionInstance
        )ro   fetchrn   s    rB   ry   zInteractionInstance.fetch   s     {{  ""rA   c                 R   K   | j                   j                          d{   S 7 w)}
        Asynchronous coroutine to fetch the InteractionInstance


        :returns: The fetched InteractionInstance
        N)ro   fetch_asyncrn   s    rB   r|   zInteractionInstance.fetch_async   s!      [[,,....rv   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      rB   	<genexpr>z/InteractionInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z(<Twilio.Proxy.V1.InteractionInstance {}>joinrf   itemsr   rh   contexts     rB   __repr__zInteractionInstance.__repr__   s6     ((SDNN<P<P<RSS9@@IIrA   )N)rj   rl   )rj   r   )r(   r)   r*   objectrC   rJ   r   r   strr   r   rc   propertyro   boolrr   ru   ry   r|   r   __classcell__ri   s   @rB   r   r      s     .v 
8 "1;1; c3h1; 	1;
 1; c]1;f   $ $0D 0#/J# JrA   r   c                   l     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defdZ xZS )rl   rK   rM   rN   rO   c                 |    t         |   |       |||d| _         dj                  di | j                  | _        y)a  
        Initialize the InteractionContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) of the resource to fetch.
        :param session_sid: The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) of the resource to fetch.
        :param sid: The Twilio-provided string that uniquely identifies the Interaction resource to fetch.
        ra   zA/Services/{service_sid}/Sessions/{session_sid}/Interactions/{sid}Nr@   rb   rc   rf   r   _uri)rh   rK   rM   rN   rO   ri   s        rB   rc   zInteractionContext.__init__   sM     	! '&
 WOVV .. 		rA   rj   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rq   DELETEmethoduriheaders)r   ofrm   rr   r   rh   r   s     rB   rr   zInteractionContext.delete   s1     ))B-}}##8G#TTrA   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rt   r   r   N)r   r   rm   ru   r   r   s     rB   ru   zInteractionContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                    t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d   | j                  d         S )	rx   application/jsonAcceptGETr   rM   rN   rO   ra   )r   r   rm   ry   r   r   rf   rh   r   rL   s      rB   ry   zInteractionContext.fetch   su     ))B-.--%%U		7%S"MM}5}5u%
 	
rA   c                 $  K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d   | j                  d   	      S 7 Ew)
r{   r   r   r   r   NrM   rN   rO   ra   )r   r   rm   r|   r   r   rf   r   s      rB   r|   zInteractionContext.fetch_async  s      ))B-.11dii 2 
 
 #MM}5}5u%
 	
	
s   ABB	ABc                     dj                  d | j                  j                         D              }dj                  |      S )r~   r   c              3   F   K   | ]  \  }}d j                  ||        ywr   r   r   s      rB   r   z.InteractionContext.__repr__.<locals>.<genexpr>&  r   r   z'<Twilio.Proxy.V1.InteractionContext {}>r   r   s     rB   r   zInteractionContext.__repr__   s6     ((SDNN<P<P<RSS8??HHrA   )r(   r)   r*   r   r   rc   r   rr   ru   r   ry   r|   r   r   r   s   @rB   rl   rl      sg    
 
c 
 
RU 
.
U 
U
D 

* 
,
#6 
0I# IrA   rl   c                   2    e Zd Zdeeef   defdZdefdZy)InteractionPagerL   rj   c                 h    t        | j                  || j                  d   | j                  d         S )zq
        Build an instance of InteractionInstance

        :param payload: Payload response from the API
        rM   rN   rM   rN   )r   rm   rf   )rh   rL   s     rB   get_instancezInteractionPage.get_instance,  s3     #MM}5}5	
 	
rA   c                      y)r~   z!<Twilio.Proxy.V1.InteractionPage>r@   rn   s    rB   r   zInteractionPage.__repr__9       3rA   N)	r(   r)   r*   r   r   r   r   r   r   r@   rA   rB   r   r   *  s*    
DcN 
7J 
3# 3rA   r   c            	           e Zd Zdededef 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 )InteractionListrK   rM   rN   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a{  
        Initialize the InteractionList

        :param version: Version that contains the resource
        :param service_sid: The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) to read the resources from.
        :param session_sid: The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) to read the resources from.

        r   z;/Services/{service_sid}/Sessions/{session_sid}/InteractionsNr@   r   )rh   rK   rM   rN   ri   s       rB   rc   zInteractionList.__init__D  sJ     	! '&

 QIPP .. 		rA   limit	page_sizerj   c                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )aa  
        Streams InteractionInstance 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   )rm   read_limitspagestreamrh   r   r   limitsr   s        rB   r   zInteractionList.streamZ  sJ    ( **5)<yy6+#6y7}}##D&/::rA   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ap  
        Asynchronously streams InteractionInstance 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   )rm   r   
page_asyncstream_asyncr   s        rB   r   zInteractionList.stream_asyncs  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists InteractionInstance 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   )rh   r   r   s      rB   r   zInteractionList.list  s(    & KK#  
 	
rA   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists InteractionInstance 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   )rh   r   r   records       rB   
list_asynczInteractionList.list_async  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )a{  
        Retrieve a single page of InteractionInstance 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 InteractionInstance
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedr   r   r   r   r   paramsr   )r   r   rm   r   r   r   rf   rh   r   r   r   rR   r   responses          rB   r   zInteractionList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 t}}hGGrA   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a  
        Asynchronously retrieve a single page of InteractionInstance 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 InteractionInstance
        r   r   r   r   r   r   r   N)r   r   rm   r   r   r   rf   r   s          rB   r   zInteractionList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 t}}hGG
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of InteractionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InteractionInstance
        r   )rm   domaintwiliorequestr   rf   rh   r   r   s      rB   get_pagezInteractionList.get_page  s=     ==''..66ujIt}}hGGrA   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a
  
        Asynchronously retrieve a specific page of InteractionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InteractionInstance
        r   N)rm   r   r   request_asyncr   rf   r   s      rB   get_page_asynczInteractionList.get_page_async  sJ      --44BB5*UUt}}hGG Vs   4AA&ArO   c                 h    t        | j                  | j                  d   | j                  d   |      S z
        Constructs a InteractionContext

        :param sid: The Twilio-provided string that uniquely identifies the Interaction resource to fetch.
        rM   rN   ra   rl   rm   rf   rh   rO   s     rB   rd   zInteractionList.get  3     "MM}5}5	
 	
rA   c                 h    t        | j                  | j                  d   | j                  d   |      S r   r   r   s     rB   __call__zInteractionList.__call__(  r   rA   c                      y)r~   z!<Twilio.Proxy.V1.InteractionList>r@   rn   s    rB   r   zInteractionList.__repr__5  r   rA   )NN)r(   r)   r*   r   r   rc   r   intr	   r   r   r
   r   r   r   r   r   unsetr   r   r   r   r   r   r   rl   rd   r   r   r   r   s   @rB   r   r   B  s#   
 
c 
 
0  $#';}; C=; 
%	&	;6  $#'A}A C=A 
*	+	A6  $#'
}
 C=
 
!	"	
8  $#'
}
 C=
 
!	"	
: *0*0,,(.	H#v+&H 3;'H f%	H
 
HF *0*0,,(.	H#v+&H 3;'H f%	H
 
HB
H3 
H? 
H
Hs 
H 
H
s 
1 

C 
$6 
3# 3rA   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rl   r   r   r@   rA   rB   <module>r      sg     L L L + 8 : 2 ' !cJ* cJLhI hIV3d 30y3l y3rA   