U
    ^g%iH                     @   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ZdS )zParticipantInstance.CodecVP8H264VP9ZopusN)__name__
__module____qualname__r   r   r   ZOPUS r   r   g/var/www/html/api-medvista/venv/lib/python3.8/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ZdZdS )zParticipantInstance.RoomStatusZin_progress	connected	completeddisconnectedN)r   r   r   ZIN_PROGRESSZ	CONNECTEDZ	COMPLETEDZDISCONNECTEDr   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   TwilioRealm2   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
   Ziso8601_datetimer(   r)   r*   r+   r%   r,   r-   r.   integerr/   r0   r1   r2   r3   r4   r5   	_solution_context)selfr#   r$   r%   r&   	__class__r   r   r8   R   s<    zParticipantInstance.__init__ParticipantContextreturnc                 C   s.   | j dk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&   r6   )r<   r@   _versionr;   r=   r   r   r   _proxy{   s    
zParticipantInstance._proxyc                 C   s
   | j  S )c
        Fetch the ParticipantInstance


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


        :returns: The fetched ParticipantInstance
        N)rE   fetch_asyncrD   r   r   r   rI      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>   s     z/ParticipantInstance.__repr__.<locals>.<genexpr>z+<Twilio.Insights.V1.ParticipantInstance {}>joinr;   itemsrN   r=   contextr   r   r   __repr__   s    zParticipantInstance.__repr__)N)r   r   r   objectr   r   r!   r"   r   r   strr   r   r8   propertyrE   rG   rI   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                    s,   t  | ||d| _djf | 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.
        r6   z6/Video/Rooms/{room_sid}/Participants/{participant_sid}Nr7   r8   r;   rN   _uri)r=   r#   r%   r&   r>   r   r   r8      s    zParticipantContext.__init__rA   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )rF   application/jsonAcceptGETmethoduriheadersr%   r&   r6   )r   ofrC   rG   r_   r   r;   r=   rf   r$   r   r   r   rG      s    
zParticipantContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	rH   r`   ra   rb   rc   Nr%   r&   r6   )r   rg   rC   rI   r_   r   r;   rh   r   r   r   rI      s    
  zParticipantContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rJ   rK   c                 s   s   | ]\}}d  ||V  qdS rL   rM   rO   r   r   r   rS      s     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[   r8   r   rG   rI   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$   rB   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   rC   r;   )r=   r$   r   r   r   get_instance   s
      zParticipantPage.get_instancerA   c                 C   s   dS )rJ   z$<Twilio.Insights.V1.ParticipantPage>r   rD   r   r   r   rY      s    zParticipantPage.__repr__N)	r   r   r   r   r[   r   r   rj   rY   r   r   r   r   ri      s   
ri   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 | 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   r8   	  s
     zParticipantList.__init__N)limit	page_sizerB   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
        rm   rm   rl   )rC   read_limitspagestreamr=   rl   rm   Zlimitsrp   r   r   r   rq     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
        rm   rn   Nrl   )rC   ro   
page_asyncstream_asyncrr   r   r   r   rt   2  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
        rl   rm   )listrq   r=   rl   rm   r   r   r   rv   K  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   )rP   recordr   r   r   
<listcomp>x  s   z.ParticipantList.list_async.<locals>.<listcomp>ru   N)rt   rw   r   r   r   
list_asynce  s    
zParticipantList.list_async)
page_tokenpage_numberrm   rB   c                 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
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedr`   ra   rb   rd   re   paramsrf   )r   rg   rC   rp   r_   ri   r;   r=   r{   r|   rm   datarf   responser   r   r   rp     s       zParticipantList.pagec                    sT   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`   ra   rb   r   N)r   rg   rC   rs   r_   ri   r;   r   r   r   r   rs     s       zParticipantList.page_async)
target_urlrB   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
        rb   )rC   domaintwiliorequestri   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
        rb   N)rC   r   r   Zrequest_asyncri   r;   r   r   r   r   get_page_async  s    	zParticipantList.get_page_async)r&   rB   c                 C   s   t | j| jd |dS zw
        Constructs a ParticipantContext

        :param participant_sid: The SID of the Participant resource.
        r%   r6   r@   rC   r;   r=   r&   r   r   r   r9     s
    zParticipantList.getc                 C   s   t | j| jd |dS r   r   r   r   r   r   __call__  s
    zParticipantList.__call__rA   c                 C   s   dS )rJ   z$<Twilio.Insights.V1.ParticipantList>r   rD   r   r   r   rY     s    zParticipantList.__repr__)NN)NN)NN)NN)r   r   r   r   r[   r8   r   intr   r   rq   r	   rt   r   rv   rz   r   unsetr   rZ   ri   rp   rs   r   r   r@   r9   r   rY   r]   r   r   r>   r   rk     sh           


#


!rk   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@   ri   rk   r   r   r   r   <module>   s   $ K