o
    f>hd                     @   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 de
deeef dedee f fddZed!ddZejejfdeeef deeef dd fddZejejfdeeef deeef dd fddZdefddZ  ZS )"ConferenceParticipantInstancec                   @   s   e Zd ZdZdZdS )z+ConferenceParticipantInstance.CallDirectioninboundoutboundN)__name__
__module____qualname__INBOUNDOUTBOUND r   r   l/var/www/html/venv/lib/python3.10/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.CallStatusanswered	completedbusyfailnoanswerringingcanceledN)
r   r   r   ANSWERED	COMPLETEDBUSYFAILNOANSWERRINGINGCANCELEDr   r   r   r   
CallStatus   s    r*   c                   @      e Zd ZdZdZdZdS )z&ConferenceParticipantInstance.CallTypecarrierclientsipN)r   r   r   CARRIERCLIENTSIPr   r   r   r   CallType(       r2   c                   @   s   e Zd ZdZdZdZdZdS )z.ConferenceParticipantInstance.JitterBufferSizelargesmallmediumoffN)r   r   r   LARGESMALLMEDIUMOFFr   r   r   r   JitterBufferSize-   s
    r<   c                   @   r+   )z-ConferenceParticipantInstance.ProcessingStatecompletein_progresstimeoutN)r   r   r   COMPLETEIN_PROGRESSTIMEOUTr   r   r   r   ProcessingState3   r3   rC   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.Regionus1us2au1br1ie1jp1sg1de1in1N)r   r   r   US1US2AU1BR1IE1JP1SG1DE1IN1r   r   r   r   Region8   s    rV   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| _ ||p| jd| _!d | _"d S )NrZ   labelrY   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rY   rZ   )#super__init__getrZ   r[   rY   r\   r]   r^   _fromr`   ra   rb   rc   r
   iso8601_datetimerd   re   integerrf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   	_solution_context)selfrW   rX   rY   rZ   	__class__r   r   rv   a   sf   
z&ConferenceParticipantInstance.__init__returnConferenceParticipantContextc                 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: ConferenceParticipantContext for this ConferenceParticipantInstance
        NrY   rZ   rt   )r|   r   _versionr{   r}   r   r   r   _proxy   s   
z$ConferenceParticipantInstance._proxyrq   rr   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
        rq   rr   )r   fetchr}   rq   rr   r   r   r   r      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
        r   N)r   fetch_asyncr   r   r   r   r      s
   z)ConferenceParticipantInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z9ConferenceParticipantInstance.__repr__.<locals>.<genexpr>z5<Twilio.Insights.V1.ConferenceParticipantInstance {}>joinr{   itemsr   r}   contextr   r   r   __repr__      
z&ConferenceParticipantInstance.__repr__N)r   r   )r   r   r   objectr   r*   r2   r<   rC   rV   r   r   strr   r   rv   propertyr   r   unsetr   r   r   r   __classcell__r   r   r~   r   r      sN    	#
E





r   c                       s   e Zd Zdededef fddZejejfdeee	f deee	f de
fd	d
Zejejfdeee	f deee	f de
fddZdefddZ  ZS )r   rW   rY   rZ   c                    s0   t  | ||d| _djdi | 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.
        rt   z</Conferences/{conference_sid}/Participants/{participant_sid}Nr   ru   rv   r{   r   _uri)r}   rW   rY   rZ   r~   r   r   rv      s   z%ConferenceParticipantContext.__init__rq   rr   r   c                 C   sV   t ||d}t i }d|d< | jjd| j||d}t| j|| jd | jd dS )	r   EventsMetricsapplication/jsonAcceptGETmethoduriparamsheadersrY   rZ   rt   )r   ofr   r   r   r   r{   r}   rq   rr   datar   rX   r   r   r   r      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 )
r   r   r   r   r   r   NrY   rZ   rt   )r   r   r   r   r   r   r{   r   r   r   r   r     s"   

z(ConferenceParticipantContext.fetch_asyncc                 C   r   )r   r   c                 s   r   r   r   r   r   r   r   r   I  r   z8ConferenceParticipantContext.__repr__.<locals>.<genexpr>z4<Twilio.Insights.V1.ConferenceParticipantContext {}>r   r   r   r   r   r   C  r   z%ConferenceParticipantContext.__repr__)r   r   r   r   r   rv   r   r   r   r   r   r   r   r   r   r   r   r~   r   r      s*    


&


$r   c                   @   s4   e Zd Zdeeef defddZdefddZdS )ConferenceParticipantPagerX   r   c                 C   s   t | j|| jd dS )z{
        Build an instance of ConferenceParticipantInstance

        :param payload: Payload response from the API
        rY   )rY   )r   r   r{   )r}   rX   r   r   r   get_instanceO  s   z&ConferenceParticipantPage.get_instancec                 C      dS )r   z.<Twilio.Insights.V1.ConferenceParticipantPage>r   r   r   r   r   r   Y     z"ConferenceParticipantPage.__repr__N)	r   r   r   r   r   r   r   r   r   r   r   r   r   r   M  s    
r   c                       s  e Zd Zdedef fddZejejejddfdeee	f deee	f deee	f d	e
e d
e
e dee fddZejejejddfdeee	f deee	f deee	f d	e
e d
e
e dee fddZejejejddfdeee	f deee	f deee	f d	e
e d
e
e dee fddZejejejddfdeee	f deee	f deee	f d	e
e d
e
e dee fddZejejejejejejfdeee	f deee	f deee	f deee	f deee	f d
eee	f defddZejejejejejejfdeee	f deee	f deee	f deee	f deee	f d
eee	f defddZdedefddZdedefddZdedefdd Zdedefd!d"Zdefd#d$Z  ZS )%ConferenceParticipantListrW   rY   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the ConferenceParticipantList

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

        rY   z*/Conferences/{conference_sid}/ParticipantsNr   r   )r}   rW   rY   r~   r   r   rv   d  s   z"ConferenceParticipantList.__init__NrZ   r[   rq   limit	page_sizer   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   rZ   r[   rq   r   r   )r   read_limitspagestreamr}   rZ   r[   rq   r   r   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   )r   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
        rZ   r[   rq   r   r   )listr   r}   rZ   r[   rq   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 r   r   )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
page_tokenpage_numberc           
   	   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
        ParticipantSidLabelr   	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedr   r   r   r   )r   r   r   r   r   r   r{   
r}   rZ   r[   rq   r   r   r   r   r   responser   r   r   r     s   
zConferenceParticipantList.pagec           
   	      s\   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   r   r   r   r   N)r   r   r   r   r   r   r{   r   r   r   r   r   /  s    
z$ConferenceParticipantList.page_async
target_urlc                 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
        r   )r   domaintwiliorequestr   r{   r}   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
        r   N)r   r   r   request_asyncr   r{   r   r   r   r   get_page_asynce  s   	z(ConferenceParticipantList.get_page_asyncc                 C      t | j| jd |dS z
        Constructs a ConferenceParticipantContext

        :param participant_sid: The unique SID identifier of the Participant.
        rY   rt   r   r   r{   r}   rZ   r   r   r   rw   q  
   zConferenceParticipantList.getc                 C   r   r   r   r   r   r   r   __call__}  r   z"ConferenceParticipantList.__call__c                 C   r   )r   z.<Twilio.Insights.V1.ConferenceParticipantList>r   r   r   r   r   r     r   z"ConferenceParticipantList.__repr__)r   r   r   r   r   rv   r   r   r   r   r   intr   r   r   r	   r   r   r   r   r   r   r   r   r   r   rw   r   r   r   r   r   r~   r   r   b  s    



&



&



%



&






,






*r   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r   r   r   r   r   r   r   <module>   s    $ Li