o
    e?                     @   s   d 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	 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       sj   e Zd ZdZ fddZdddZdddZejejejfd	d
Z	dd Z
dd Zdd Zdd Z  ZS )ParticipantListk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                    s2   t t| | d|i| _djdi | j| _dS )aB  
        Initialize the ParticipantList

        :param Version version: Version that contains the resource
        :param room_sid: Unique identifier for the room.

        :returns: twilio.rest.insights.v1.room.participant.ParticipantList
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantList
        room_sidz$/Video/Rooms/{room_sid}/ParticipantsN )superr   __init__	_solutionformat_uri)selfversionr
   	__class__r   [/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/insights/v1/room/participant.pyr      s   

zParticipantList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.insights.v1.room.participant.ParticipantInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   %   s   zParticipantList.streamc                 C   s   t | j||dS )al  
        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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.insights.v1.room.participant.ParticipantInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   <   s   zParticipantList.listc                 C   s6   t |||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 str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ParticipantInstance
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   ParticipantPager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   N   s   zParticipantList.pagec                 C   s"   | j jjd|}t| j || jS )aH  
        Retrieve a specific page of ParticipantInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ParticipantInstance
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantPage
        r    )r   domaintwiliorequestr%   r   )r   
target_urlr)   r   r   r   get_pagea   s
   

zParticipantList.get_pagec                 C      t | j| jd |dS a  
        Constructs a ParticipantContext

        :param participant_sid: The SID of the Participant resource.

        :returns: twilio.rest.insights.v1.room.participant.ParticipantContext
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantContext
        r
   r
   participant_sidParticipantContextr   r   r   r2   r   r   r   getr   
   	zParticipantList.getc                 C   r/   r0   r3   r5   r   r   r   __call__   r7   zParticipantList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Insights.V1.ParticipantList>r   r   r   r   r   __repr__      zParticipantList.__repr__)NN)__name__
__module____qualname____doc__r   r   r   r   unsetr   r.   r6   r8   r<   __classcell__r   r   r   r   r      s    


r   c                       0   e Zd ZdZ fddZdd Zdd Z  ZS )r%   r	   c                    s   t t| || || _dS )az  
        Initialize the ParticipantPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param room_sid: Unique identifier for the room.

        :returns: twilio.rest.insights.v1.room.participant.ParticipantPage
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantPage
        N)r   r%   r   r   )r   r   r)   solutionr   r   r   r      s   
zParticipantPage.__init__c                 C   s   t | j|| jd dS )a  
        Build an instance of ParticipantInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.insights.v1.room.participant.ParticipantInstance
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantInstance
        r
   )r
   )ParticipantInstancer   r   r   payloadr   r   r   get_instance   s   	zParticipantPage.get_instancec                 C   r9   )r:   z$<Twilio.Insights.V1.ParticipantPage>r   r;   r   r   r   r<      r=   zParticipantPage.__repr__)r>   r?   r@   rA   r   rI   r<   rC   r   r   r   r   r%      s
    r%   c                       rD   )r4   r	   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the ParticipantContext

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

        :returns: twilio.rest.insights.v1.room.participant.ParticipantContext
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantContext
        r1   z6/Video/Rooms/{room_sid}/Participants/{participant_sid}Nr   )r   r4   r   r   r   r   )r   r   r
   r2   r   r   r   r      s   zParticipantContext.__init__c                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the ParticipantInstance

        :returns: The fetched ParticipantInstance
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantInstance
        r    )r!   r"   r
   r2   r1   )r   fetchr   rF   r   rG   r   r   r   rK      s   zParticipantContext.fetchc                 C   $   d dd | j D }d|S )r:    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>       z.ParticipantContext.__repr__.<locals>.<genexpr>z*<Twilio.Insights.V1.ParticipantContext {}>joinr   itemsr   r   contextr   r   r   r<         
zParticipantContext.__repr__)r>   r?   r@   rA   r   rK   r<   rC   r   r   r   r   r4      s
    r4   c                       sJ  e Zd 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d5 fdd	Z	e
dd Ze
dd Ze
dd Ze
dd Ze
dd Ze
dd Ze
dd Ze
dd Ze
dd Ze
dd  Ze
d!d" Ze
d#d$ Ze
d%d& Ze
d'd( Ze
d)d* Ze
d+d, Ze
d-d. Ze
d/d0 Zd1d2 Zd3d4 Z  ZS )6rF   r	   c                   @   s   e Zd ZdZdZdS )zParticipantInstance.RoomStatusin_progress	completedN)r>   r?   r@   IN_PROGRESS	COMPLETEDr   r   r   r   
RoomStatus   s    ra   c                   @   s   e Zd ZdZdZdZdS )zParticipantInstance.CodecVP8H264VP9N)r>   r?   r@   rb   rc   rd   r   r   r   r   Codec   s    re   c                   @   s4   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S )z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   r   TwilioRealm   s    rz   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    r   Nc                    s  t t| | i d|dd|ddt|ddt|ddt|dd|dd|dd|dd	|d	d
|d
dt|dd|dd|dd|dd|dd|dd|d| _d| _||p| jd d| _	dS )z
        Initialize the ParticipantInstance

        :returns: twilio.rest.insights.v1.room.participant.ParticipantInstance
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantInstance
        r2   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urlNr1   )
r   rF   r   r6   r   iso8601_datetimeinteger_properties_contextr   )r   r   rH   r
   r2   r   r   r   r     sP   





	







zParticipantInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )a>  
        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
        :rtype: twilio.rest.insights.v1.room.participant.ParticipantContext
        Nr
   r2   r1   )r   r4   r   r   r;   r   r   r   _proxy<  s   
	zParticipantInstance._proxyc                 C   
   | j d S )zZ
        :returns: Unique identifier for the participant.
        :rtype: unicode
        r2   r   r;   r   r   r   r2   M     
z#ParticipantInstance.participant_sidc                 C   r   )z
        :returns: The application-defined string that uniquely identifies the participant within a Room.
        :rtype: unicode
        r   r   r;   r   r   r   r   U  r   z(ParticipantInstance.participant_identityc                 C   r   )zZ
        :returns: When the participant joined the room.
        :rtype: datetime
        r   r   r;   r   r   r   r   ]  r   zParticipantInstance.join_timec                 C   r   )zW
        :returns: When the participant left the room
        :rtype: datetime
        r   r   r;   r   r   r   r   e  r   zParticipantInstance.leave_timec                 C   r   )zn
        :returns: Amount of time in seconds the participant was in the room.
        :rtype: unicode
        r   r   r;   r   r   r   r   m  r   z ParticipantInstance.duration_secc                 C   r   )zY
        :returns: Account SID associated with the room.
        :rtype: unicode
        r   r   r;   r   r   r   r   u  r   zParticipantInstance.account_sidc                 C   r   )zS
        :returns: Unique identifier for the room.
        :rtype: unicode
        r
   r   r;   r   r   r   r
   }  r   zParticipantInstance.room_sidc                 C   r   )z^
        :returns: Status of the room.
        :rtype: ParticipantInstance.RoomStatus
        r   r   r;   r   r   r   r     r   zParticipantInstance.statusc                 C   r   )zq
        :returns: Codecs detected from the participant.
        :rtype: list[ParticipantInstance.Codec]
        r   r   r;   r   r   r   r     r   zParticipantInstance.codecsc                 C   r   )zY
        :returns: Reason the participant left the room.
        :rtype: unicode
        r   r   r;   r   r   r   r     r   zParticipantInstance.end_reasonc                 C   r   )zZ
        :returns: Errors encountered by the participant.
        :rtype: unicode
        r   r   r;   r   r   r   r     r   zParticipantInstance.error_codec                 C   r   )zV
        :returns: Twilio error code dictionary link.
        :rtype: unicode
        r   r   r;   r   r   r   r     r   z"ParticipantInstance.error_code_urlc                 C   r   )z}
        :returns: Twilio media region the participant connected to.
        :rtype: ParticipantInstance.TwilioRealm
        r   r   r;   r   r   r   r     r   z ParticipantInstance.media_regionc                 C   r   )zz
        :returns: Object containing information about the participant's data from the room.
        :rtype: dict
        r   r   r;   r   r   r   r     r   zParticipantInstance.propertiesc                 C   r   )z
        :returns: Name of the edge location the participant connected to.
        :rtype: ParticipantInstance.EdgeLocation
        r   r   r;   r   r   r   r     r   z!ParticipantInstance.edge_locationc                 C   r   )zn
        :returns: Object containing information about the SDK name and version.
        :rtype: dict
        r   r   r;   r   r   r   r     r   z"ParticipantInstance.publisher_infoc                 C   r   )zT
        :returns: URL of the participant resource.
        :rtype: unicode
        r   r   r;   r   r   r   r     r   zParticipantInstance.urlc                 C   s
   | j  S )rJ   )r   rK   r;   r   r   r   rK     s   
zParticipantInstance.fetchc                 C   rL   )r:   rM   c                 s   rN   rO   rP   rQ   r   r   r   rU     rV   z/ParticipantInstance.__repr__.<locals>.<genexpr>z+<Twilio.Insights.V1.ParticipantInstance {}>rW   rZ   r   r   r   r<     r\   zParticipantInstance.__repr__)N) r>   r?   r@   rA   objectra   re   rz   r   r   propertyr   r2   r   r   r   r   r   r
   r   r   r   r   r   r   r   r   r   r   rK   r<   rC   r   r   r   r   rF      sZ    %

















	rF   N)rA   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r%   r4   rF   r   r   r   r   <module>   s    
)0