a
    !fE                     @   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ee	e
ef e
ee
 d
 fddZeddddZd dddZd dddZe
dddZ  ZS )ParticipantInstancec                   @   s   e Zd ZdZdZdZdS )zParticipantInstance.CodecVP8H264VP9N)__name__
__module____qualname__r   r   r    r   r   i/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/insights/v1/room/participant.pyCodec   s   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.EdgeLocationZashburnZdublinZ	frankfurt	singaporeZsydneyZ	sao_pauloroamingZumatillaZtokyoN)r   r   r   ZASHBURNZDUBLINZ	FRANKFURTZ	SINGAPOREZSYDNEYZ	SAO_PAULOZROAMINGZUMATILLAZTOKYOr   r   r   r   EdgeLocation    s   r   c                   @   s   e Zd ZdZdZdS )zParticipantInstance.RoomStatusZin_progress	completedN)r   r   r   ZIN_PROGRESSZ	COMPLETEDr   r   r   r   
RoomStatus+   s   r   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.TwilioRealmZus1Zus2Zau1Zbr1Zie1Zjp1Zsg1Zin1Zde1ZgllN)r   r   r   ZUS1ZUS2ZAU1ZBR1ZIE1ZJP1ZSG1ZIN1ZDE1ZGLLr   r   r   r   TwilioRealm/   s   r    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| _||p| jd| _d | _d S )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'   r(   r)   r#   r*   r+   r,   integerr-   r.   r/   r0   r1   r2   r3   	_solution_context)selfr!   r"   r#   r$   	__class__r   r   r6   O   s<    zParticipantInstance.__init__ParticipantContextreturnc                 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
        Nr#   r$   r4   )r;   r?   _versionr:   r<   r   r   r   _proxyx   s    
zParticipantInstance._proxyc                 C   s
   | j  S )c
        Fetch the ParticipantInstance


        :returns: The fetched ParticipantInstance
        )rD   fetchrC   r   r   r   rF      s    zParticipantInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the ParticipantInstance


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

        :returns: Machine friendly representation
         c                 s   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:   itemsrM   r<   contextr   r   r   __repr__   s    zParticipantInstance.__repr__)N)r   r   r   objectr   r   r   r    r   r   strr   r   r6   propertyrD   rF   rH   rY   __classcell__r   r   r=   r   r      s    % 
)		r   c                       sP   e Zd Zeeed fddZedddZedddZedd	d
Z	  Z
S )r?   )r!   r#   r$   c                    s0   t  | ||d| _djf 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.
        r4   z6/Video/Rooms/{room_sid}/Participants/{participant_sid}Nr5   r6   r:   rM   _uri)r<   r!   r#   r$   r=   r   r   r6      s    zParticipantContext.__init__r@   c                 C   s0   | j jd| jd}t| j || jd | jd dS )rE   GETmethodurir#   r$   r4   )rB   rF   r_   r   r:   r<   r"   r   r   r   rF      s    zParticipantContext.fetchc                    s6   | j jd| jdI dH }t| j || jd | jd dS )rG   r`   ra   Nr#   r$   r4   )rB   rH   r_   r   r:   rd   r   r   r   rH      s    zParticipantContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rI   rJ   c                 s   s   | ]\}}d  ||V  qdS rK   rL   rN   r   r   r   rR      rS   z.ParticipantContext.__repr__.<locals>.<genexpr>z*<Twilio.Insights.V1.ParticipantContext {}>rT   rW   r   r   r   rY      s    zParticipantContext.__repr__)r   r   r   r   r[   r6   r   rF   rH   rY   r]   r   r   r=   r   r?      s   r?   c                   @   s2   e Zd Zeeef edddZedddZdS )ParticipantPage)r"   rA   c                 C   s   t | j|| jd dS )zq
        Build an instance of ParticipantInstance

        :param payload: Payload response from the API
        r#   )r#   )r   rB   r:   rd   r   r   r   get_instance   s    zParticipantPage.get_instancer@   c                 C   s   dS )rI   z$<Twilio.Insights.V1.ParticipantPage>r   rC   r   r   r   rY      s    zParticipantPage.__repr__N)	r   r   r   r   r[   r   r   rf   rY   r   r   r   r   re      s   
re   c                       sf  e Zd Zeed fddZd ee ee ee	 dddZ
d!ee ee ee	 ddd	Zd"ee ee ee	 dd
dZd#ee ee ee	 dddZejejejfeeef eeef eeef edddZejejejfeeef eeef eeef edddZeedddZeedddZeedddZeedddZedddZ  ZS )$ParticipantList)r!   r#   c                    s.   t  | d|i| _djf i | j| _dS )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<   r!   r#   r=   r   r   r6      s    zParticipantList.__init__N)limit	page_sizerA   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
        ri   ri   rh   )rB   read_limitspagestreamr<   rh   ri   Zlimitsrl   r   r   r   rm     s    zParticipantList.streamc                    s6   | 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
        ri   rj   Nrh   )rB   rk   
page_asyncstream_asyncrn   r   r   r   rp   (  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
        rh   ri   )listrm   r<   rh   ri   r   r   r   rr   A  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 )Nr   )rO   recordr   r   r   
<listcomp>n  s   z.ParticipantList.list_async.<locals>.<listcomp>rq   N)rp   rs   r   r   r   
list_async[  s    
zParticipantList.list_async)
page_tokenpage_numberri   rA   c                 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 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
        Z	PageTokenr   ZPageSizer`   rb   rc   params)r   ofrB   rl   r_   re   r:   r<   rw   rx   ri   dataresponser   r   r   rl   v  s    zParticipantList.pagec                    s<   t |||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
        ry   r`   rz   N)r   r|   rB   ro   r_   re   r:   r}   r   r   r   ro     s    zParticipantList.page_async)
target_urlrA   c                 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`   )rB   domaintwiliorequestre   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)rB   r   r   Zrequest_asyncre   r:   r   r   r   r   get_page_async  s    	zParticipantList.get_page_async)r$   rA   c                 C   s   t | j| jd |dS zw
        Constructs a ParticipantContext

        :param participant_sid: The SID of the Participant resource.
        r#   r4   r?   rB   r:   r<   r$   r   r   r   r7     s
    zParticipantList.getc                 C   s   t | j| jd |dS r   r   r   r   r   r   __call__  s
    zParticipantList.__call__r@   c                 C   s   dS )rI   z$<Twilio.Insights.V1.ParticipantList>r   rC   r   r   r   rY     s    zParticipantList.__repr__)NN)NN)NN)NN)r   r   r   r   r[   r6   r   intr   r   rm   r	   rp   r   rr   rv   r   unsetr   rZ   re   rl   ro   r   r   r?   r7   r   rY   r]   r   r   r=   r   rg      sh           





rg   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r?   re   rg   r   r   r   r   <module>   s   $ F