
    piH                         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 - Insights
    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 G d de      Z G d de      Z	 	 dd	ed
e	e
ef   de
dee
   f fdZedd       ZddZddZde
fdZ xZS )ParticipantInstancec                       e Zd ZdZdZdZdZy)ParticipantInstance.CodecVP8H264VP9opusN)__name__
__module____qualname__r   r   r   OPUS     j/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/insights/v1/room/participant.pyCodecr      s    r   r!   c                   0    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zy
) ParticipantInstance.EdgeLocationashburndublin	frankfurt	singaporesydney	sao_pauloroamingumatillatokyoN)r   r   r   ASHBURNDUBLIN	FRANKFURT	SINGAPORESYDNEY	SAO_PAULOROAMINGUMATILLATOKYOr   r   r    EdgeLocationr#   !   s/    			r   r6   c                       e Zd ZdZdZdZdZy)ParticipantInstance.RoomStatusin_progress	connected	completeddisconnectedN)r   r   r   IN_PROGRESS	CONNECTED	COMPLETEDDISCONNECTEDr   r   r    
RoomStatusr8   ,   s    #		%r   rA   c                   4    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
Zy)ParticipantInstance.TwilioRealmus1us2au1br1ie1jp1sg1in1de1gllN)r   r   r   US1US2AU1BR1IE1JP1SG1IN1DE1GLLr   r   r    TwilioRealmrC   2   s4    r   rX   versionpayloadroom_sidparticipant_sidc                    t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d      | _	        |j                  d      | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        t        j                  |j                  d            | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )Nr\   participant_identity	join_time
leave_timeduration_secaccount_sidr[   statuscodecs
end_reason
error_codeerror_code_urlmedia_region
propertiesedge_locationpublisher_infourlr[   r\   )super__init__getr\   r^   r   iso8601_datetimer_   r`   ra   rb   r[   rc   rd   re   integerrf   rg   rh   ri   rj   rk   rl   	_solution_context)selfrY   rZ   r[   r\   	__class__s        r    ro   zParticipantInstance.__init__R   s    	!.5kk:K.L3:;;?U3V!-8-I-IKK$.
 /:.J.JKK%/
 ,3;;~+F*1++m*D'.{{:'>BI++hBWCJ;;xCX)0\)B)4)<)<W[[=V)W-4[[9I-JIPJ
 8?{{<7PKR;;L
 <C;;GW;X")++e"4 !.F$2F2F
 7;r   returnc                     | j                   7t        | j                  | 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: ParticipantContext for this ParticipantInstance
        r[   r\   rm   )rt   ParticipantContext_versionrs   ru   s    r    _proxyzParticipantInstance._proxy{   sF     == .
3 $/@ ADM
 }}r   c                 6    | j                   j                         S )c
        Fetch the ParticipantInstance


        :returns: The fetched ParticipantInstance
        )r|   fetchr{   s    r    r   zParticipantInstance.fetch   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)}
        Asynchronous coroutine to fetch the ParticipantInstance


        :returns: The fetched ParticipantInstance
        N)r|   fetch_asyncr{   s    r    r   zParticipantInstance.fetch_async   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/ParticipantInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z+<Twilio.Insights.V1.ParticipantInstance {}>joinrs   itemsr   ru   contexts     r    __repr__zParticipantInstance.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr   )N)rw   ry   )rw   r   )r   r   r   objectr!   r6   rA   rX   r   r   strr   r   ro   propertyr|   r   r   r   __classcell__rv   s   @r    r   r      s     	v 	&V &
f 
2 *.';'; c3h'; 	';
 "#';R  #/M# Mr   r   c                   P     e Zd Z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	 xZ
S )	ry   rY   r[   r\   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)z
        Initialize the ParticipantContext

        :param version: Version that contains the resource
        :param room_sid: The SID of the Room resource.
        :param participant_sid: The SID of the Participant resource.
        rm   z6/Video/Rooms/{room_sid}/Participants/{participant_sid}Nr   rn   ro   rs   r   _uri)ru   rY   r[   r\   rv   s       r    ro   zParticipantContext.__init__   sG     	! !.
 TLSS 
nn
	r   rw   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )r~   application/jsonAcceptGETmethoduriheadersr[   r\   rm   )r   ofrz   r   r   r   rs   ru   r   rZ   s      r    r   zParticipantContext.fetch   sj     ))B-.--%%U		7%S"MM^^J/ NN+<=	
 	
r   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	r   r   r   r   r   Nr[   r\   rm   )r   r   rz   r   r   r   rs   r   s      r    r   zParticipantContext.fetch_async   s      ))B-.11dii 2 
 
 #MM^^J/ NN+<=	
 	
	
s   ABB 	8Bc                     dj                  d | j                  j                         D              }dj                  |      S )r   r   c              3   F   K   | ]  \  }}d j                  ||        ywr   r   r   s      r    r   z.ParticipantContext.__repr__.<locals>.<genexpr>   r   r   z*<Twilio.Insights.V1.ParticipantContext {}>r   r   s     r    r   zParticipantContext.__repr__   s6     ((SDNN<P<P<RSS;BB7KKr   )r   r   r   r   r   ro   r   r   r   r   r   r   s   @r    ry   ry      sE    
 
3 
 
&
* 
*
#6 
.L# Lr   ry   c                   2    e Zd Zdeeef   defdZdefdZy)ParticipantPagerZ   rw   c                 L    t        | j                  || j                  d         S )zq
        Build an instance of ParticipantInstance

        :param payload: Payload response from the API
        r[   )r[   )r   rz   rs   )ru   rZ   s     r    get_instancezParticipantPage.get_instance   s%     #MM7T^^J-G
 	
r   c                      y)r   z$<Twilio.Insights.V1.ParticipantPage>r   r{   s    r    r   zParticipantPage.__repr__        6r   N)	r   r   r   r   r   r   r   r   r   r   r   r    r   r      s*    
DcN 
7J 
6# 6r   r   c            	           e Zd Z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 )ParticipantListrY   r[   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the ParticipantList

        :param version: Version that contains the resource
        :param room_sid: The SID of the Room resource.

        r[   z$/Video/Rooms/{room_sid}/ParticipantsNr   r   )ru   rY   r[   rv   s      r    ro   zParticipantList.__init__	  sA     	! 
 B:AASDNNS	r   limit	page_sizerw   c                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )aa  
        Streams ParticipantInstance 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   )rz   read_limitspagestreamru   r   r   limitsr   s        r    r   zParticipantList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ap  
        Asynchronously streams ParticipantInstance 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   )rz   r   
page_asyncstream_asyncr   s        r    r   zParticipantList.stream_async2  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists ParticipantInstance 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   )ru   r   r   s      r    r   zParticipantList.listK  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 ParticipantInstance 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   )ru   r   r   records       r    
list_asynczParticipantList.list_asynce  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 ParticipantInstance 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 ParticipantInstance
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedr   r   r   r   r   paramsr   )r   r   rz   r   r   r   rs   ru   r   r   r   datar   responses          r    r   zParticipantList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 t}}hGGr   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 ParticipantInstance 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 ParticipantInstance
        r   r   r   r   r   r   r   N)r   r   rz   r   r   r   rs   r   s          r    r   zParticipantList.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 ParticipantInstance records from the API.
        Request is executed immediately

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

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

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

        :returns: Page of ParticipantInstance
        r   N)rz   r   r   request_asyncr   rs   r   s      r    get_page_asynczParticipantList.get_page_async  sJ      --44BB5*UUt}}hGG Vs   4AA&Ar\   c                 L    t        | j                  | j                  d   |      S zw
        Constructs a ParticipantContext

        :param participant_sid: The SID of the Participant resource.
        r[   rm   ry   rz   rs   ru   r\   s     r    rp   zParticipantList.get  '     "MM^^J/+
 	
r   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r    __call__zParticipantList.__call__  r   r   c                      y)r   z$<Twilio.Insights.V1.ParticipantList>r   r{   s    r    r   zParticipantList.__repr__  r   r   )NN)r   r   r   r   r   ro   r   intr	   r   r   r
   r   r   r   r   r   unsetr   r   r   r   r   r   r   ry   rp   r   r   r   r   s   @r    r   r     s   T T3 T$  $#';}; 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

3 

+= 



 

0B 

6# 6r   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   ry   r   r   r   r   r    <module>r      sg     L L L + 8 : 2 ' !KM* KM\HL HLV6d 6*q6l q6r   