o
    f>hI                     @   s   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 de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 - 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                
       s   e Zd ZG dd deZG dd deZG dd deZG dd deZ	 		dd
ede	e
ef de
dee
 f fddZedddZdddZdddZde
fddZ  ZS )ParticipantInstancec                   @      e Zd ZdZdZdZdZdS )zParticipantInstance.CodecVP8H264VP9opusN)__name__
__module____qualname__r   r   r   OPUS r   r   [/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/insights/v1/room/participant.pyCodec   
    r   c                   @   s0   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )z 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   r   EdgeLocation!   s    r1   c                   @   r   )zParticipantInstance.RoomStatusin_progress	connected	completeddisconnectedN)r   r   r   IN_PROGRESS	CONNECTED	COMPLETEDDISCONNECTEDr   r   r   r   
RoomStatus,   r   r:   c                   @   sd   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dZdS )zParticipantInstance.TwilioRealmus1us2au1br1ie1jp1sg1in1de1gll	stage_us1dev_us1	stage_au1	stage_sg1	stage_br1	stage_in1	stage_jp1	stage_de1	stage_ie1	stage_us2dev_us2outsideN)r   r   r   US1US2AU1BR1IE1JP1SG1IN1DE1GLL	STAGE_US1DEV_US1	STAGE_AU1	STAGE_SG1	STAGE_BR1	STAGE_IN1	STAGE_JP1	STAGE_DE1	STAGE_IE1	STAGE_US2DEV_US2OUTSIDEr   r   r   r   TwilioRealm2   s.    rg   Nversionpayloadroom_sidparticipant_sidc                    s  t  | |d| _|d| _t|d| _t|d| _|d| _	|d| _
|d| _|d| _|d	| _|d
| _t|d| _|d| _|d| _|d| _|d| _|d| _|d| _||pz| jd| _d | _d S )Nrk   participant_identity	join_time
leave_timeduration_secaccount_sidrj   statuscodecs
end_reason
error_codeerror_code_urlmedia_region
propertiesedge_locationpublisher_infourlrj   rk   )super__init__getrk   rl   r
   iso8601_datetimerm   rn   ro   rp   rj   rq   rr   rs   integerrt   ru   rv   rw   rx   ry   rz   	_solution_context)selfrh   ri   rj   rk   	__class__r   r   r}   ^   s<   
zParticipantInstance.__init__returnParticipantContextc                 C   s.   | j du rt| j| jd | 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: ParticipantContext for this ParticipantInstance
        Nrj   rk   r{   )r   r   _versionr   r   r   r   r   _proxy   s   
zParticipantInstance._proxyc                 C   s
   | j  S )c
        Fetch the ParticipantInstance


        :returns: The fetched ParticipantInstance
        )r   fetchr   r   r   r   r      s   
zParticipantInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the ParticipantInstance


        :returns: The fetched ParticipantInstance
        N)r   fetch_asyncr   r   r   r   r      s   zParticipantInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z/ParticipantInstance.__repr__.<locals>.<genexpr>z+<Twilio.Insights.V1.ParticipantInstance {}>joinr   itemsr   r   contextr   r   r   __repr__      
zParticipantInstance.__repr__N)r   r   )r   r   )r   r   r   objectr   r1   r:   rg   r   r   strr   r   r}   propertyr   r   r   r   __classcell__r   r   r   r   r      s*    
)

		r   c                       sT   e Zd Zdededef fddZdefddZdefd	d
ZdefddZ	  Z
S )r   rh   rj   rk   c                    s0   t  | ||d| _djdi | j| _dS )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.
        r{   z6/Video/Rooms/{room_sid}/Participants/{participant_sid}Nr   r|   r}   r   r   _uri)r   rh   rj   rk   r   r   r   r}      s   zParticipantContext.__init__r   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r   application/jsonAcceptGETmethoduriheadersrj   rk   r{   )r   ofr   r   r   r   r   r   r   ri   r   r   r   r      s   
zParticipantContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r   r   r   r   r   Nrj   rk   r{   )r   r   r   r   r   r   r   r   r   r   r   r      s   
zParticipantContext.fetch_asyncc                 C   r   )r   r   c                 s   r   r   r   r   r   r   r   r      r   z.ParticipantContext.__repr__.<locals>.<genexpr>z*<Twilio.Insights.V1.ParticipantContext {}>r   r   r   r   r   r      r   zParticipantContext.__repr__)r   r   r   r   r   r}   r   r   r   r   r   r   r   r   r   r      s
    r   c                   @   s4   e Zd Zdeeef defddZdefddZdS )ParticipantPageri   r   c                 C   s   t | j|| jd dS )zq
        Build an instance of ParticipantInstance

        :param payload: Payload response from the API
        rj   )rj   )r   r   r   )r   ri   r   r   r   get_instance   s   zParticipantPage.get_instancec                 C      dS )r   z$<Twilio.Insights.V1.ParticipantPage>r   r   r   r   r   r   
     zParticipantPage.__repr__N)	r   r   r   r   r   r   r   r   r   r   r   r   r   r      s    
r   c                	       s  e Zd Zdedef fddZ		d#dee dee dee	 fd	d
Z
		d#dee dee dee	 fddZ		d#dee dee dee	 fddZ		d#dee dee dee	 fd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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dZdedefddZdedefddZdedefddZdedefdd Zdefd!d"Z  ZS )$ParticipantListrh   rj   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the ParticipantList

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

        rj   z$/Video/Rooms/{room_sid}/ParticipantsNr   r   )r   rh   rj   r   r   r   r}     s   zParticipantList.__init__Nlimit	page_sizer   c                 C   s0   | j ||}| j|d d}| 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   )r   read_limitspagestreamr   r   r   limitsr   r   r   r   r   %  s   zParticipantList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )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   )r   r   
page_asyncstream_asyncr   r   r   r   r   >  s   zParticipantList.stream_asyncc                 C   s   t | j||d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   r   r   r   r   r   r   r   W  s   zParticipantList.listc                    s&   dd | j ||dI dH 2 I dH S )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
        c                    s   g | z3 d H W }|q6 S r   r   )r   recordr   r   r   
<listcomp>  s
    z.ParticipantList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_asyncq  s   
zParticipantList.list_async
page_tokenpage_numberc                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}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   r   r   r   r   r   r   r   r   r   datar   responser   r   r   r     s   
zParticipantList.pagec                    sV   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	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   r   r   r   r   r   r   r   r   r   r     s   
zParticipantList.page_async
target_urlc                 C   s"   | 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   )r   domaintwiliorequestr   r   r   r   r   r   r   r   get_page  s   	zParticipantList.get_pagec                    s*   | j jjd|I dH }t| j || jS )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)r   r   r   request_asyncr   r   r   r   r   r   get_page_async  s   	zParticipantList.get_page_asyncrk   c                 C      t | j| jd |dS zw
        Constructs a ParticipantContext

        :param participant_sid: The SID of the Participant resource.
        rj   r{   r   r   r   r   rk   r   r   r   r~     
   zParticipantList.getc                 C   r   r   r   r   r   r   r   __call__  r   zParticipantList.__call__c                 C   r   )r   z$<Twilio.Insights.V1.ParticipantList>r   r   r   r   r   r     r   zParticipantList.__repr__)NN)r   r   r   r   r   r}   r   intr   r   r   r	   r   r   r   r   r   unsetr   r   r   r   r   r   r   r   r~   r   r   r   r   r   r   r   r     s    







#



!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   r   r   r   r   r   r   r   <module>   s    $ K