U
    ^g%id                     @   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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ejejfeeef eeef d dddZejejfeeef eeef d dddZedddZ  ZS )ConferenceParticipantInstancec                   @   s   e Zd ZdZdZdS )z+ConferenceParticipantInstance.CallDirectionZinboundZoutboundN)__name__
__module____qualname__ZINBOUNDZOUTBOUND r   r   x/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/insights/v1/conference/conference_participant.pyCallDirection   s   r   c                   @   s(   e Zd ZdZdZdZdZdZdZdZ	dS )	z(ConferenceParticipantInstance.CallStatusZanswered	completedbusyZfailZnoanswerZringingcanceledN)
r   r   r   ZANSWEREDZ	COMPLETEDZBUSYZFAILZNOANSWERZRINGINGZCANCELEDr   r   r   r   
CallStatus   s   r   c                   @   s   e Zd ZdZdZdZdS )z&ConferenceParticipantInstance.CallTypeZcarrierclientsipN)r   r   r   ZCARRIERZCLIENTZSIPr   r   r   r   CallType(   s   r   c                   @   s   e Zd ZdZdZdZdZdS )z.ConferenceParticipantInstance.JitterBufferSizeZlargeZsmallZmediumoffN)r   r   r   ZLARGEZSMALLZMEDIUMZOFFr   r   r   r   JitterBufferSize-   s   r    c                   @   s   e Zd ZdZdZdZdS )z-ConferenceParticipantInstance.ProcessingStateZcompleteZin_progresstimeoutN)r   r   r   ZCOMPLETEZIN_PROGRESSTIMEOUTr   r   r   r   ProcessingState3   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$ConferenceParticipantInstance.RegionZus1Zus2Zau1Zbr1Zie1Zjp1Zsg1Zde1Zin1N)r   r   r   ZUS1ZUS2ZAU1ZBR1ZIE1ZJP1ZSG1ZDE1ZIN1r   r   r   r   Region8   s   r$   N)versionpayloadconference_sidparticipant_sidc                    s  t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _t|d| _t|d| _t|d| _t|d| _t|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _ ||pz| jd| _!d | _"d S )Nr(   labelr'   call_sidaccount_sidcall_directionfromtocall_statuscountry_codeis_moderator	join_time
leave_timeduration_secondsoutbound_queue_lengthoutbound_time_in_queuejitter_buffer_sizeis_coachcoached_participantsparticipant_regionconference_region	call_typeprocessing_state
propertieseventsmetricsurlr'   r(   )#super__init__getr(   r)   r'   r*   r+   r,   Z_fromr.   r/   r0   r1   r
   Ziso8601_datetimer2   r3   integerr4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   	_solution_context)selfr%   r&   r'   r(   	__class__r   r   rD   a   sf    
z&ConferenceParticipantInstance.__init__ConferenceParticipantContextreturnc                 C   s.   | j dk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: ConferenceParticipantContext for this ConferenceParticipantInstance
        Nr'   r(   rB   )rH   rL   _versionrG   rI   r   r   r   _proxy   s    
z$ConferenceParticipantInstance._proxyr?   r@   rN   c                 C   s   | j j||dS )7  
        Fetch the ConferenceParticipantInstance

        :param events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :param metrics: Object. Contains participant call quality metrics.

        :returns: The fetched ConferenceParticipantInstance
        r?   r@   )rQ   fetchrI   r?   r@   r   r   r   rU      s    z#ConferenceParticipantInstance.fetchc                    s   | j j||dI dH S )Q  
        Asynchronous coroutine to fetch the ConferenceParticipantInstance

        :param events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :param metrics: Object. Contains participant call quality metrics.

        :returns: The fetched ConferenceParticipantInstance
        rT   N)rQ   fetch_asyncrV   r   r   r   rX      s    z)ConferenceParticipantInstance.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     z9ConferenceParticipantInstance.__repr__.<locals>.<genexpr>z5<Twilio.Insights.V1.ConferenceParticipantInstance {}>joinrG   itemsr]   rI   contextr   r   r   __repr__   s    z&ConferenceParticipantInstance.__repr__)N)r   r   r   objectr   r   r   r    r#   r$   r   r   strr   r   rD   propertyrQ   r   unsetr   rU   rX   rh   __classcell__r   r   rJ   r   r      s<   	. 
E



r   c                       s   e Zd Zeeed fddZejejfeee	f eee	f e
dddZejejfeee	f eee	f e
dddZed	d
dZ  ZS )rL   )r%   r'   r(   c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the ConferenceParticipantContext

        :param version: Version that contains the resource
        :param conference_sid: The unique SID identifier of the Conference.
        :param participant_sid: The unique SID identifier of the Participant.
        rB   z</Conferences/{conference_sid}/Participants/{participant_sid}NrC   rD   rG   r]   _uri)rI   r%   r'   r(   rJ   r   r   rD      s    z%ConferenceParticipantContext.__init__rR   c                 C   sV   t ||d}t i }d|d< | jjd| j||d}t| j|| jd | jd dS )	rS   EventsZMetricsapplication/jsonAcceptGETmethoduriparamsheadersr'   r(   rB   )r   ofrO   rU   ro   r   rG   rI   r?   r@   rx   ry   r&   r   r   r   rU      s&    
   z"ConferenceParticipantContext.fetchc                    s\   t ||d}t i }d|d< | jjd| j||dI dH }t| j|| jd | jd d	S )
rW   rp   rr   rs   rt   ru   Nr'   r(   rB   )r   rz   rO   rX   ro   r   rG   r{   r   r   r   rX     s&    
   z(ConferenceParticipantContext.fetch_asyncrM   c                 C   s$   d dd | j D }d|S )rY   rZ   c                 s   s   | ]\}}d  ||V  qdS r[   r\   r^   r   r   r   rb   I  s     z8ConferenceParticipantContext.__repr__.<locals>.<genexpr>z4<Twilio.Insights.V1.ConferenceParticipantContext {}>rc   rf   r   r   r   rh   C  s    z%ConferenceParticipantContext.__repr__)r   r   r   r   rj   rD   r   rl   r   ri   r   rU   rX   rh   rm   r   r   rJ   r   rL      s    

&

$rL   c                   @   s2   e Zd Zeeef edddZedddZdS )ConferenceParticipantPage)r&   rN   c                 C   s   t | j|| jd dS )z{
        Build an instance of ConferenceParticipantInstance

        :param payload: Payload response from the API
        r'   )r'   )r   rO   rG   )rI   r&   r   r   r   get_instanceO  s
      z&ConferenceParticipantPage.get_instancerM   c                 C   s   dS )rY   z.<Twilio.Insights.V1.ConferenceParticipantPage>r   rP   r   r   r   rh   Y  s    z"ConferenceParticipantPage.__repr__N)	r   r   r   r   rj   r   r   r}   rh   r   r   r   r   r|   M  s   
r|   c                	       sr  e Zd Zeed fddZejejejddfeee	f eee	f eee	f e
e e
e ee dddZejejejddfeee	f eee	f eee	f e
e e
e ee ddd	Zejejejddfeee	f eee	f eee	f e
e e
e ee dd
dZejejejddfeee	f eee	f eee	f e
e e
e ee dddZejejejejejejfeee	f eee	f eee	f eee	f eee	f eee	f edddZejejejejejejfeee	f eee	f eee	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 ) ConferenceParticipantList)r%   r'   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the ConferenceParticipantList

        :param version: Version that contains the resource
        :param conference_sid: The unique SID identifier of the Conference.

        r'   z*/Conferences/{conference_sid}/ParticipantsNrn   )rI   r%   r'   rJ   r   r   rD   d  s     z"ConferenceParticipantList.__init__N)r(   r)   r?   limit	page_sizerN   c                 C   s6   | j ||}| j||||d d}| j ||d S )ax  
        Streams ConferenceParticipantInstance 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 str participant_sid: The unique SID identifier of the Participant.
        :param str label: User-specified label for a participant.
        :param str events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :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?   r   r   )rO   read_limitspagestreamrI   r(   r)   r?   r   r   Zlimitsr   r   r   r   r   v  s    z ConferenceParticipantList.streamc                    s<   | j ||}| j||||d dI dH }| j ||d S )a  
        Asynchronously streams ConferenceParticipantInstance 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 str participant_sid: The unique SID identifier of the Participant.
        :param str label: User-specified label for a participant.
        :param str events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :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   )rO   r   
page_asyncstream_asyncr   r   r   r   r     s    z&ConferenceParticipantList.stream_asyncc                 C   s   t | j|||||dS )a  
        Lists ConferenceParticipantInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str participant_sid: The unique SID identifier of the Participant.
        :param str label: User-specified label for a participant.
        :param str events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :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)   r?   r   r   )listr   rI   r(   r)   r?   r   r   r   r   r   r     s    zConferenceParticipantList.listc                    s*   dd | j |||||dI dH 2 I dH S )a$  
        Asynchronously lists ConferenceParticipantInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str participant_sid: The unique SID identifier of the Participant.
        :param str label: User-specified label for a participant.
        :param str events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :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   )r_   recordr   r   r   
<listcomp>  s   z8ConferenceParticipantList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async  s    
z$ConferenceParticipantList.list_async)r(   r)   r?   
page_tokenpage_numberr   rN   c           
   	   C   sT   t ||||||d}t ddi}d|d< | jjd| j||d}	t| j|	| jS )a  
        Retrieve a single page of ConferenceParticipantInstance records from the API.
        Request is executed immediately

        :param participant_sid: The unique SID identifier of the Participant.
        :param label: User-specified label for a participant.
        :param events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :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 ConferenceParticipantInstance
        ZParticipantSidLabelrq   Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrr   rs   rt   ru   )r   rz   rO   r   ro   r|   rG   
rI   r(   r)   r?   r   r   r   datary   responser   r   r   r     s$       zConferenceParticipantList.pagec           
   	      sZ   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 ConferenceParticipantInstance records from the API.
        Request is executed immediately

        :param participant_sid: The unique SID identifier of the Participant.
        :param label: User-specified label for a participant.
        :param events: Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc.
        :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 ConferenceParticipantInstance
        r   r   r   rr   rs   rt   ru   N)r   rz   rO   r   ro   r|   rG   r   r   r   r   r   /  s$       z$ConferenceParticipantList.page_async)
target_urlrN   c                 C   s"   | j jjd|}t| j || jS )a  
        Retrieve a specific page of ConferenceParticipantInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ConferenceParticipantInstance
        rt   )rO   domaintwiliorequestr|   rG   rI   r   r   r   r   r   get_pageY  s    	z"ConferenceParticipantList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of ConferenceParticipantInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ConferenceParticipantInstance
        rt   N)rO   r   r   Zrequest_asyncr|   rG   r   r   r   r   get_page_asynce  s    	z(ConferenceParticipantList.get_page_async)r(   rN   c                 C   s   t | j| jd |dS z
        Constructs a ConferenceParticipantContext

        :param participant_sid: The unique SID identifier of the Participant.
        r'   rB   rL   rO   rG   rI   r(   r   r   r   rE   q  s
    zConferenceParticipantList.getc                 C   s   t | j| jd |dS r   r   r   r   r   r   __call__}  s
    z"ConferenceParticipantList.__call__rM   c                 C   s   dS )rY   z.<Twilio.Insights.V1.ConferenceParticipantList>r   rP   r   r   r   rh     s    z"ConferenceParticipantList.__repr__)r   r   r   r   rj   rD   r   rl   r   ri   r   intr   r   r   r	   r   r   r   r   r|   r   r   r   r   rL   rE   r   rh   rm   r   r   rJ   r   r~   b  s   


&


&


%


&





,





*r~   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   rL   r|   r~   r   r   r   r   <module>   s   $ Li