U
    hRfE                     @   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   L/tmp/pip-unpacked-wheel-74se_viw/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	frankfurtZ	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_progressZ	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-   r.   r/   r0   r1   	_solution_context)selfr   r    r!   r"   	__class__r   r   r4   O   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"   r2   )r9   r=   _versionr8   r:   r   r   r   _proxyx   s    
zParticipantInstance._proxyc                 C   s
   | j  S )c
        Fetch the ParticipantInstance


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


        :returns: The fetched ParticipantInstance
        N)rB   fetch_asyncrA   r   r   r   rF      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 {}>joinr8   itemsrK   r:   contextr   r   r   __repr__   s    zParticipantInstance.__repr__)N)r   r   r   objectr   r   r   r   r   r   strr   r   r4   propertyrB   rD   rF   rV   __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.
        r2   z6/Video/Rooms/{room_sid}/Participants/{participant_sid}Nr3   r4   r8   rK   _uri)r:   r   r!   r"   r;   r   r   r4      s    zParticipantContext.__init__r>   c                 C   s0   | j jd| jd}t| j || jd | jd dS )rC   GETmethodurir!   r"   r2   )r@   rD   r\   r   r8   r:   r    r   r   r   rD      s    zParticipantContext.fetchc                    s6   | j jd| jdI dH }t| j || jd | jd dS )rE   r]   r^   Nr!   r"   r2   )r@   rF   r\   r   r8   ra   r   r   r   rF      s    zParticipantContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rG   rH   c                 s   s   | ]\}}d  ||V  qdS rI   rJ   rL   r   r   r   rP      s     z.ParticipantContext.__repr__.<locals>.<genexpr>z*<Twilio.Insights.V1.ParticipantContext {}>rQ   rT   r   r   r   rV      s    zParticipantContext.__repr__)r   r   r   r   rX   r4   r   rD   rF   rV   rZ   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    r?   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   r@   r8   ra   r   r   r   get_instance   s
      zParticipantPage.get_instancer>   c                 C   s   dS )rG   z$<Twilio.Insights.V1.ParticipantPage>r   rA   r   r   r   rV      s    zParticipantPage.__repr__N)	r   r   r   r   rX   r   r   rc   rV   r   r   r   r   rb      s   
rb   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   r4     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
        rf   rf   re   )r@   read_limitspagestreamr:   re   rf   Zlimitsri   r   r   r   rj     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
        rf   rg   Nre   )r@   rh   
page_asyncstream_asyncrk   r   r   r   rm   +  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
        re   rf   )listrj   r:   re   rf   r   r   r   ro   D  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   )rM   recordr   r   r   
<listcomp>q  s   z.ParticipantList.list_async.<locals>.<listcomp>rn   N)rm   rp   r   r   r   
list_async^  s    
zParticipantList.list_async)
page_tokenpage_numberrf   r?   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]   r_   r`   params)r   ofr@   ri   r\   rb   r8   r:   rt   ru   rf   dataresponser   r   r   ri   y  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
        rv   r]   rw   N)r   ry   r@   rl   r\   rb   r8   rz   r   r   r   rl     s      zParticipantList.page_async)
target_urlr?   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]   )r@   domaintwiliorequestrb   r8   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   Zrequest_asyncrb   r8   r   r   r   r   get_page_async  s    	zParticipantList.get_page_async)r"   r?   c                 C   s   t | j| jd |dS zw
        Constructs a ParticipantContext

        :param participant_sid: The SID of the Participant resource.
        r!   r2   r=   r@   r8   r:   r"   r   r   r   r5     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 )rG   z$<Twilio.Insights.V1.ParticipantList>r   rA   r   r   r   rV     s    zParticipantList.__repr__)NN)NN)NN)NN)r   r   r   r   rX   r4   r   intr   r   rj   r	   rm   r   ro   rs   r   Zunsetr   rW   rb   ri   rl   r   r   r=   r5   r   rV   rZ   r   r   r;   r   rd      sh           





rd   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=   rb   rd   r   r   r   r   <module>   s   $ G