o
    eT                     @   s   d 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	 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd Z fddZejejejddfddZejejejddfddZejejejejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )ConferenceParticipantListc                    s2   t t| | d|i| _djdi | j| _dS )ax  
        Initialize the ConferenceParticipantList

        :param Version version: Version that contains the resource
        :param conference_sid: Conference SID.

        :returns: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantList
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantList
        conference_sidz*/Conferences/{conference_sid}/ParticipantsN )superr   __init__	_solutionformat_uri)selfversionr	   	__class__r
   l/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/insights/v1/conference/conference_participant.pyr      s   

z"ConferenceParticipantList.__init__Nc                 C   s6   | j ||}| j||||d d}| j ||d S )a  
        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 unicode participant_sid: Participant SID.
        :param unicode label: User-specified label for a participant.
        :param unicode events: Conference events generated by application or participant activity.
        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance]
        	page_size)participant_sidlabeleventsr   limit)_versionread_limitspagestream)r   r   r   r   r   r   limitsr   r
   r
   r   r   #   s   z ConferenceParticipantList.streamc                 C   s   t | j|||||dS )as  
        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 unicode participant_sid: Participant SID.
        :param unicode label: User-specified label for a participant.
        :param unicode events: Conference events generated by application or participant activity.
        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance]
        )r   r   r   r   r   )listr   )r   r   r   r   r   r   r
   r
   r   r   C   s   zConferenceParticipantList.listc           	   	   C   s<   t ||||||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 unicode participant_sid: Participant SID.
        :param unicode label: User-specified label for a participant.
        :param unicode events: Conference events generated by application or participant activity.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ConferenceParticipantInstance
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantPage
        )ParticipantSidLabelEvents	PageTokenr   PageSizeGETmethoduriparams)r   ofr   r   r   ConferenceParticipantPager   )	r   r   r   r   
page_tokenpage_numberr   dataresponser
   r
   r   r   _   s   	zConferenceParticipantList.pagec                 C   s"   | j jjd|}t| j || jS )aw  
        Retrieve a specific page of ConferenceParticipantInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ConferenceParticipantInstance
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantPage
        r%   )r   domaintwiliorequestr+   r   )r   
target_urlr/   r
   r
   r   get_page}   s
   

z"ConferenceParticipantList.get_pagec                 C      t | j| jd |dS a>  
        Constructs a ConferenceParticipantContext

        :param participant_sid: Participant SID.

        :returns: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantContext
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantContext
        r	   r	   r   ConferenceParticipantContextr   r   r   r   r
   r
   r   get   
   	zConferenceParticipantList.getc                 C   r5   r6   r8   r:   r
   r
   r   __call__   r<   z"ConferenceParticipantList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z.<Twilio.Insights.V1.ConferenceParticipantList>r
   r   r
   r
   r   __repr__      z"ConferenceParticipantList.__repr__)__name__
__module____qualname__r   r   unsetr   r   r   r4   r;   r=   rA   __classcell__r
   r
   r   r   r      s     
 

r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )r+   c                    s   t t| || || _dS )a  
        Initialize the ConferenceParticipantPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param conference_sid: Conference SID.

        :returns: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantPage
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantPage
        N)r   r+   r   r   )r   r   r/   solutionr   r
   r   r      s   
z"ConferenceParticipantPage.__init__c                 C   s   t | j|| jd dS )aS  
        Build an instance of ConferenceParticipantInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance
        r	   )r	   )ConferenceParticipantInstancer   r   )r   payloadr
   r
   r   get_instance   s
   	z&ConferenceParticipantPage.get_instancec                 C   r>   )r?   z.<Twilio.Insights.V1.ConferenceParticipantPage>r
   r@   r
   r
   r   rA      rB   z"ConferenceParticipantPage.__repr__)rC   rD   rE   r   rK   rA   rG   r
   r
   r   r   r+      s    r+   c                       s6   e Zd Z fddZejejfddZdd Z  ZS )r9   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the ConferenceParticipantContext

        :param Version version: Version that contains the resource
        :param conference_sid: Conference SID.
        :param participant_sid: Participant SID.

        :returns: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantContext
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantContext
        r7   z</Conferences/{conference_sid}/Participants/{participant_sid}Nr
   )r   r9   r   r   r   r   )r   r   r	   r   r   r
   r   r      s   z%ConferenceParticipantContext.__init__c                 C   sB   t ||d}| jjd| j|d}t| j|| jd | jd dS )  
        Fetch the ConferenceParticipantInstance

        :param unicode events: Conference events generated by application or participant activity.
        :param unicode metrics: Object. Contains call quality metrics.

        :returns: The fetched ConferenceParticipantInstance
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance
        )r"   Metricsr%   r&   r	   r   r7   )r   r*   r   fetchr   rI   r   )r   r   metricsr.   rJ   r
   r
   r   rN      s   
z"ConferenceParticipantContext.fetchc                 C   $   d dd | j D }d|S )r?    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z8ConferenceParticipantContext.__repr__.<locals>.<genexpr>z4<Twilio.Insights.V1.ConferenceParticipantContext {}>joinr   itemsr   r   contextr
   r
   r   rA   	     
z%ConferenceParticipantContext.__repr__)	rC   rD   rE   r   r   rF   rN   rA   rG   r
   r
   r   r   r9      s    r9   c                       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	dL fdd	Z
edd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zed d! Zed"d# Zed$d% Zed&d' Zed(d) Zed*d+ Zed,d- Zed.d/ Zed0d1 Zed2d3 Zed4d5 Zed6d7 Zed8d9 Z ed:d; Z!ed<d= Z"ed>d? Z#ed@dA Z$edBdC Z%edDdE Z&edFdG Z'e(j)e(j)fdHdIZ*dJdK Z+  Z,S )MrI   c                   @   s   e Zd ZdZdZdS )z+ConferenceParticipantInstance.CallDirectioninboundoutboundN)rC   rD   rE   INBOUNDOUTBOUNDr
   r
   r
   r   CallDirection  s    re   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)
rC   rD   rE   ANSWERED	COMPLETEDBUSYFAILNOANSWERRINGINGCANCELEDr
   r
   r
   r   
CallStatus  s    rt   c                   @   s   e Zd ZdZdZdZdZdS )z.ConferenceParticipantInstance.JitterBufferSizelargesmallmediumoffN)rC   rD   rE   LARGESMALLMEDIUMOFFr
   r
   r
   r   JitterBufferSize#  s
    r}   c                   @   s,   e 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de1N)rC   rD   rE   US1US2AU1BR1IE1JP1SG1DE1r
   r
   r
   r   Region)  s    r   c                   @      e Zd ZdZdZdZdS )z&ConferenceParticipantInstance.CallTypecarrierclientsipN)rC   rD   rE   CARRIERCLIENTSIPr
   r
   r
   r   CallType3      r   c                   @   r   )z-ConferenceParticipantInstance.ProcessingStatecompletein_progresstimeoutN)rC   rD   rE   COMPLETEIN_PROGRESSTIMEOUTr
   r
   r
   r   ProcessingState8  r   r   Nc                    sv  t t| | i d|dd|dd|dd|dd|dd|dd|dd	|d	d
|d
d|dd|ddt|ddt|ddt|ddt|ddt|dd|d|d|d|d|d|d|d|d|d|d|dd
| _d| _||p| jd d| _	dS ) a  
        Initialize the ConferenceParticipantInstance

        :returns: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantInstance
        r   r   r	   call_sidaccount_sidcall_directionfrom_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
propertiesr   rO   url)
r   r   r   r   r   r   r   r   rO   r   Nr7   )
r   rI   r   r;   r   iso8601_datetimeinteger_properties_contextr   )r   r   rJ   r	   r   r   r
   r   r   =  sf   








	




z&ConferenceParticipantInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )am  
        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
        :rtype: twilio.rest.insights.v1.conference.conference_participant.ConferenceParticipantContext
        Nr	   r   r7   )r   r9   r   r   r@   r
   r
   r   _proxyl  s   
	z$ConferenceParticipantInstance._proxyc                 C   
   | j d S )zM
        :returns: SID for this participant.
        :rtype: unicode
        r   r   r@   r
   r
   r   r   }     
z-ConferenceParticipantInstance.participant_sidc                 C   r   )za
        :returns: The user-specified label of this participant.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z#ConferenceParticipantInstance.labelc                 C   r   )zC
        :returns: Conference SID.
        :rtype: unicode
        r	   r   r@   r
   r
   r   r	     r   z,ConferenceParticipantInstance.conference_sidc                 C   r   )zV
        :returns: Unique SID identifier of the call.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z&ConferenceParticipantInstance.call_sidc                 C   r   )z@
        :returns: Account SID.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z)ConferenceParticipantInstance.account_sidc                 C   r   )zz
        :returns: Call direction of the participant.
        :rtype: ConferenceParticipantInstance.CallDirection
        r   r   r@   r
   r
   r   r     r   z,ConferenceParticipantInstance.call_directionc                 C   r   )zS
        :returns: Caller ID of the calling party.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z#ConferenceParticipantInstance.from_c                 C   r   )zA
        :returns: Called party.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z ConferenceParticipantInstance.toc                 C   r   )z
        :returns: Call status of the call that generated the participant.
        :rtype: ConferenceParticipantInstance.CallStatus
        r   r   r@   r
   r
   r   r     r   z)ConferenceParticipantInstance.call_statusc                 C   r   )z`
        :returns: ISO alpha-2 country code of the participant.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z*ConferenceParticipantInstance.country_codec                 C   r   )z
        :returns: Boolean. Indicates whether participant had startConferenceOnEnter=true or endConferenceOnExit=true.
        :rtype: bool
        r   r   r@   r
   r
   r   r     r   z*ConferenceParticipantInstance.is_moderatorc                 C   r   )zb
        :returns: ISO 8601 timestamp of participant join event.
        :rtype: datetime
        r   r   r@   r
   r
   r   r     r   z'ConferenceParticipantInstance.join_timec                 C   r   )zc
        :returns: ISO 8601 timestamp of participant leave event.
        :rtype: datetime
        r   r   r@   r
   r
   r   r     r   z(ConferenceParticipantInstance.leave_timec                 C   r   )zU
        :returns: Participant durations in seconds.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z.ConferenceParticipantInstance.duration_secondsc                 C   r   )z]
        :returns: Estimated time in queue at call creation.
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z3ConferenceParticipantInstance.outbound_queue_lengthc                 C   r   )zS
        :returns: Actual time in queue (seconds).
        :rtype: unicode
        r   r   r@   r
   r
   r   r     r   z4ConferenceParticipantInstance.outbound_time_in_queuec                 C   r   )z
        :returns: The Jitter Buffer Size of this Conference Participant.
        :rtype: ConferenceParticipantInstance.JitterBufferSize
        r   r   r@   r
   r
   r   r     r   z0ConferenceParticipantInstance.jitter_buffer_sizec                 C   r   )zd
        :returns: Boolean. Indicated whether participant was a coach.
        :rtype: bool
        r   r   r@   r
   r
   r   r     r   z&ConferenceParticipantInstance.is_coachc                 C   r   )z`
        :returns: Call SIDs coached by this participant.
        :rtype: list[unicode]
        r   r   r@   r
   r
   r   r     r   z2ConferenceParticipantInstance.coached_participantsc                 C   r   )z
        :returns: Twilio region where the participant media originates.
        :rtype: ConferenceParticipantInstance.Region
        r   r   r@   r
   r
   r   r     r   z0ConferenceParticipantInstance.participant_regionc                 C   r   )z
        :returns: The Conference Region of this Conference Participant.
        :rtype: ConferenceParticipantInstance.Region
        r   r   r@   r
   r
   r   r     r   z/ConferenceParticipantInstance.conference_regionc                 C   r   )z
        :returns: The Call Type of this Conference Participant.
        :rtype: ConferenceParticipantInstance.CallType
        r   r   r@   r
   r
   r   r   %  r   z'ConferenceParticipantInstance.call_typec                 C   r   )z
        :returns: Processing state of the Participant Summary.
        :rtype: ConferenceParticipantInstance.ProcessingState
        r   r   r@   r
   r
   r   r   -  r   z.ConferenceParticipantInstance.processing_statec                 C   r   )zU
        :returns: Participant properties and metadata.
        :rtype: dict
        r   r   r@   r
   r
   r   r   5  r   z(ConferenceParticipantInstance.propertiesc                 C   r   )z
        :returns: Object containing information of actions taken by participants. Nested resource URLs.
        :rtype: dict
        r   r   r@   r
   r
   r   r   =  r   z$ConferenceParticipantInstance.eventsc                 C   r   )z^
        :returns: Object. Contains participant quality metrics.
        :rtype: dict
        rO   r   r@   r
   r
   r   rO   E  r   z%ConferenceParticipantInstance.metricsc                 C   r   )zM
        :returns: The URL of this resource.
        :rtype: unicode
        r   r   r@   r
   r
   r   r   M  r   z!ConferenceParticipantInstance.urlc                 C   s   | j j||dS )rL   )r   rO   )r   rN   )r   r   rO   r
   r
   r   rN   U  s   
z#ConferenceParticipantInstance.fetchc                 C   rP   )r?   rQ   c                 s   rR   rS   rT   rU   r
   r
   r   rY   h  rZ   z9ConferenceParticipantInstance.__repr__.<locals>.<genexpr>z5<Twilio.Insights.V1.ConferenceParticipantInstance {}>r[   r^   r
   r
   r   rA   a  r`   z&ConferenceParticipantInstance.__repr__)N)-rC   rD   rE   objectre   rt   r}   r   r   r   r   propertyr   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rO   r   r   rF   rN   rA   rG   r
   r
   r   r   rI     s    	
/



























rI   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r+   r9   rI   r
   r
   r
   r   <module>   s    &+3