o
    ew                     @   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
 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)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                %       s0  e Zd Z fddZejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejejej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 )ParticipantListc                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the ParticipantList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource
        :param conference_sid: The SID of the conference the participant is in

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantList
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantList
        account_sidconference_sidzF/Accounts/{account_sid}/Conferences/{conference_sid}/Participants.jsonN )superr	   __init__	_solutionformat_uri)selfversionr   r   	__class__r   g/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/api/v2010/account/conference/participant.pyr      s   zParticipantList.__init__c(           *   
   C   sL  t i d|d|d|d|dt|dd d|d	|d
|d|	d|
d|d|d|d|d|d|d|i d|d|d|dt|dd d|d|d|d|d|d|d|d |d!t|d"d d#t|d$d d%| d&|!d'|"|#|$|%|&|'d(}(| jjd)| j|(d*})t| j|)| jd+ | jd, d-S ).as  
        Create the ParticipantInstance

        :param unicode from_: The phone number, Client identifier, or username portion of SIP address that made this call.
        :param unicode to: The phone number, SIP address or Client identifier that received this call.
        :param unicode status_callback: The URL we should call to send status information to your application
        :param unicode status_callback_method: The HTTP method we should use to call `status_callback`
        :param list[unicode] status_callback_event: Set state change events that will trigger a callback
        :param unicode label: The label of this participant
        :param unicode timeout: he number of seconds that we should wait for an answer
        :param bool record: Whether to record the participant and their conferences
        :param bool muted: Whether to mute the agent
        :param unicode beep: Whether to play a notification beep to the conference when the participant joins
        :param bool start_conference_on_enter: Whether the conference starts when the participant joins the conference
        :param bool end_conference_on_exit: Whether to end the conference when the participant leaves
        :param unicode wait_url: URL that hosts pre-conference hold music
        :param unicode wait_method: The HTTP method we should use to call `wait_url`
        :param bool early_media: Whether agents can hear the state of the outbound call
        :param unicode max_participants: The maximum number of agent conference participants
        :param unicode conference_record: Whether to record the conference the participant is joining
        :param unicode conference_trim: Whether to trim leading and trailing silence from your recorded conference audio files
        :param unicode conference_status_callback: The callback URL for conference events
        :param unicode conference_status_callback_method: HTTP method for requesting `conference_status_callback` URL
        :param list[unicode] conference_status_callback_event: The conference state changes that should generate a call to `conference_status_callback`
        :param unicode recording_channels: Specify `mono` or `dual` recording channels
        :param unicode recording_status_callback: The URL that we should call using the `recording_status_callback_method` when the recording status changes
        :param unicode recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`
        :param unicode sip_auth_username: The SIP username used for authentication
        :param unicode sip_auth_password: The SIP password for authentication
        :param unicode region: The region where we should mix the conference audio
        :param unicode conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available
        :param unicode conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`
        :param list[unicode] recording_status_callback_event: The recording state changes that should generate a call to `recording_status_callback`
        :param list[unicode] conference_recording_status_callback_event: The conference recording state changes that should generate a call to `conference_recording_status_callback`
        :param bool coaching: Indicates if the participant changed to coach
        :param unicode call_sid_to_coach: The SID of the participant who is being `coached`
        :param unicode jitter_buffer_size: Jitter Buffer size for the connecting participant
        :param unicode byoc: BYOC trunk SID (Beta)
        :param unicode caller_id: The phone number, Client identifier, or username portion of SIP address that made this call.
        :param unicode call_reason: Reason for the call (Branded Calls Beta)
        :param unicode recording_track: The track(s) to record
        :param unicode time_limit: The maximum duration of the call in seconds.

        :returns: The created ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        FromToStatusCallbackStatusCallbackMethodStatusCallbackEventc                 S      | S Nr   er   r   r   <lambda>q       z(ParticipantList.create.<locals>.<lambda>LabelTimeoutRecordMutedBeepStartConferenceOnEnterEndConferenceOnExitWaitUrl
WaitMethod
EarlyMediaMaxParticipantsConferenceRecordConferenceTrimConferenceStatusCallbackConferenceStatusCallbackMethodConferenceStatusCallbackEventc                 S   r   r   r   r   r   r   r   r!      r"   RecordingChannelsRecordingStatusCallbackRecordingStatusCallbackMethodSipAuthUsernameSipAuthPasswordRegion!ConferenceRecordingStatusCallback'ConferenceRecordingStatusCallbackMethodRecordingStatusCallbackEventc                 S   r   r   r   r   r   r   r   r!      r"   &ConferenceRecordingStatusCallbackEventc                 S   r   r   r   r   r   r   r   r!      r"   CoachingCallSidToCoachJitterBufferSize)ByocCallerId
CallReasonRecordingTrack	TimeLimitPOSTmethoduridatar   r   r
   )	r   ofr   map_versioncreater   ParticipantInstancer   )*r   from_tostatus_callbackstatus_callback_methodstatus_callback_eventlabeltimeoutrecordmutedbeepstart_conference_on_enterend_conference_on_exitwait_urlwait_methodearly_mediamax_participantsconference_recordconference_trimconference_status_callback!conference_status_callback_method conference_status_callback_eventrecording_channelsrecording_status_callback recording_status_callback_methodsip_auth_usernamesip_auth_passwordregion$conference_recording_status_callback+conference_recording_status_callback_methodrecording_status_callback_event*conference_recording_status_callback_eventcoachingcall_sid_to_coachjitter_buffer_sizebyoc	caller_idcall_reasonrecording_track
time_limitrI   payloadr   r   r   rM   %   s   G	
 !"#
*zParticipantList.createNc                 C   s6   | j ||}| j||||d d}| j ||d S )a  
        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 bool muted: Whether to return only participants that are muted
        :param bool hold: Whether to return only participants that are on hold
        :param bool coaching: Whether to return only participants who are coaching another call
        :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.api.v2010.account.conference.participant.ParticipantInstance]
        	page_size)rW   holdrn   rw   limit)rL   read_limitspagestream)r   rW   rx   rn   ry   rw   limitsr{   r   r   r   r|      s   zParticipantList.streamc                 C   s   t | j|||||dS )au  
        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 bool muted: Whether to return only participants that are muted
        :param bool hold: Whether to return only participants that are on hold
        :param bool coaching: Whether to return only participants who are coaching another call
        :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.api.v2010.account.conference.participant.ParticipantInstance]
        )rW   rx   rn   ry   rw   )listr|   )r   rW   rx   rn   ry   rw   r   r   r   r~      s   zParticipantList.listc           	   	   C   s<   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 bool muted: Whether to return only participants that are muted
        :param bool hold: Whether to return only participants that are on hold
        :param bool coaching: Whether to return only participants who are coaching another call
        :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 ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantPage
        )r&   Holdr=   	PageTokenr   PageSizeGET)rG   rH   params)r   rJ   rL   r{   r   ParticipantPager   )	r   rW   rx   rn   
page_tokenpage_numberrw   rI   responser   r   r   r{      s   	zParticipantList.pagec                 C   s"   | j jjd|}t| j || jS )aT  
        Retrieve a specific page of ParticipantInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantPage
        r   )rL   domaintwiliorequestr   r   )r   
target_urlr   r   r   r   get_page   s
   

zParticipantList.get_pagec                 C      t | j| jd | jd |dS a<  
        Constructs a ParticipantContext

        :param call_sid: The Call SID or URL encoded label of the participant to fetch

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        r   r   r   r   call_sidParticipantContextrL   r   r   r   r   r   r   get     	zParticipantList.getc                 C   r   r   r   r   r   r   r   __call__  r   zParticipantList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Api.V2010.ParticipantList>r   r   r   r   r   __repr__%     zParticipantList.__repr__)__name__
__module____qualname__r   r   unsetrM   r|   r~   r{   r   r   r   r   __classcell__r   r   r   r   r	      sT    
z


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 ParticipantPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The SID of the Account that created the resource
        :param conference_sid: The SID of the conference the participant is in

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantPage
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantPage
        N)r   r   r   r   )r   r   r   solutionr   r   r   r   1  s   
zParticipantPage.__init__c                 C   s   t | j|| jd | jd dS )a+  
        Build an instance of ParticipantInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        r   r   r
   )rN   rL   r   r   rv   r   r   r   get_instanceB  s   	zParticipantPage.get_instancec                 C   r   )r   z"<Twilio.Api.V2010.ParticipantPage>r   r   r   r   r   r   R  r   zParticipantPage.__repr__)r   r   r   r   r   r   r   r   r   r   r   r   /  s    r   c                       sn   e Zd Z fddZdd ZejejejejejejejejejejejejfddZdd Zd	d
 Z	  Z
S )r   c                    s6   t t| | |||d| _djdi | j| _dS )a.  
        Initialize the ParticipantContext

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource to fetch
        :param conference_sid: The SID of the conference with the participant to fetch
        :param call_sid: The Call SID or URL encoded label of the participant to fetch

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        r   zQ/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid}.jsonNr   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   ^  s   zParticipantContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the ParticipantInstance

        :returns: The fetched ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        r   rG   rH   r   r   r   r   )rL   fetchr   rN   r   r   r   r   r   r   t  s   zParticipantContext.fetchc                 C   s^   t |||||||||	|
||d}| jjd| j|d}t| j|| jd | jd | jd dS )  
        Update the ParticipantInstance

        :param bool muted: Whether the participant should be muted
        :param bool hold: Whether the participant should be on hold
        :param unicode hold_url: The URL we call using the `hold_method` for  music that plays when the participant is on hold
        :param unicode hold_method: The HTTP method we should use to call hold_url
        :param unicode announce_url: The URL we call using the `announce_method` for an announcement to the participant
        :param unicode announce_method: The HTTP method we should use to call announce_url
        :param unicode wait_url: URL that hosts pre-conference hold music
        :param unicode wait_method: The HTTP method we should use to call `wait_url`
        :param bool beep_on_exit: Whether to play a notification beep to the conference when the participant exit
        :param bool end_conference_on_exit: Whether to end the conference when the participant leaves
        :param bool coaching: Indicates if the participant changed to coach
        :param unicode call_sid_to_coach: The SID of the participant who is being `coached`

        :returns: The updated ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        )r&   r   HoldUrl
HoldMethodAnnounceUrlAnnounceMethodr*   r+   
BeepOnExitr)   r=   r>   rE   rF   r   r   r   r   )r   rJ   rL   updater   rN   r   )r   rW   rx   hold_urlhold_methodannounce_urlannounce_methodr[   r\   beep_on_exitrZ   rn   ro   rI   rv   r   r   r   r     s,   zParticipantContext.updatec                 C   s   | j jd| jdS )
        Deletes the ParticipantInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr   )rL   deleter   r   r   r   r   r     s   zParticipantContext.deletec                 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>      z.ParticipantContext.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.ParticipantContext {}>joinr   itemsr   r   contextr   r   r   r        
zParticipantContext.__repr__)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   \  s    
2	r   c                       s6  e Zd ZG dd deZ	d, 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d$d% Zejejejejejejejejejejejejfd&d'Zd(d) Zd*d+ Z  ZS )-rN   c                   @   s$   e Zd ZdZdZdZdZdZdZdS )zParticipantInstance.Statusqueued
connectingringing	connectedcompletefailedN)	r   r   r   QUEUED
CONNECTINGRINGING	CONNECTEDCOMPLETEFAILEDr   r   r   r   Status  s    r   Nc                    s   t t| | |d|d|d|d|d|dt|dt|d|d	|d
|d|d|d|dd| _d| _|||pU| jd d| _dS )z
        Initialize the ParticipantInstance

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        r   r   rT   ro   rn   r   date_createddate_updatedrZ   rW   rx   rY   statusrH   )r   r   rT   ro   rn   r   r   r   rZ   rW   rx   rY   r   rH   Nr   )	r   rN   r   r   r   rfc2822_datetime_properties_contextr   )r   r   rv   r   r   r   r   r   r   r     s*   zParticipantInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )aJ  
        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
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        Nr   r   r   r   )r   r   rL   r   r   r   r   r   _proxy  s   
	zParticipantInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r   r   r   r   r   r   r        
zParticipantInstance.account_sidc                 C   r   )zg
        :returns: The SID of the Call the resource is associated with
        :rtype: unicode
        r   r   r   r   r   r   r     r   zParticipantInstance.call_sidc                 C   r   )zQ
        :returns: The label of this participant
        :rtype: unicode
        rT   r   r   r   r   r   rT     r   zParticipantInstance.labelc                 C   r   )ze
        :returns: The SID of the participant who is being `coached`
        :rtype: unicode
        ro   r   r   r   r   r   ro   #  r   z%ParticipantInstance.call_sid_to_coachc                 C   r   )z^
        :returns: Indicates if the participant changed to coach
        :rtype: bool
        rn   r   r   r   r   r   rn   +  r   zParticipantInstance.coachingc                 C   r   )zc
        :returns: The SID of the conference the participant is in
        :rtype: unicode
        r   r   r   r   r   r   r   3  r   z"ParticipantInstance.conference_sidc                 C   r   )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        r   r   r   r   r   r   r   ;  r   z ParticipantInstance.date_createdc                 C   r   )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        r   r   r   r   r   r   r   C  r   z ParticipantInstance.date_updatedc                 C   r   )zh
        :returns: Whether the conference ends when the participant leaves
        :rtype: bool
        rZ   r   r   r   r   r   rZ   K  r   z*ParticipantInstance.end_conference_on_exitc                 C   r   )zQ
        :returns: Whether the participant is muted
        :rtype: bool
        rW   r   r   r   r   r   rW   S  r   zParticipantInstance.mutedc                 C   r   )zS
        :returns: Whether the participant is on hold
        :rtype: bool
        rx   r   r   r   r   r   rx   [  r   zParticipantInstance.holdc                 C   r   )zx
        :returns: Whether the conference starts when the participant joins the conference
        :rtype: bool
        rY   r   r   r   r   r   rY   c  r   z-ParticipantInstance.start_conference_on_enterc                 C   r   )zx
        :returns: The status of the participant's call in a session
        :rtype: ParticipantInstance.Status
        r   r   r   r   r   r   r   k  r   zParticipantInstance.statusc                 C   r   )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        rH   r   r   r   r   r   rH   s  r   zParticipantInstance.uric                 C   
   | j  S )r   )r   r   r   r   r   r   r   {     
zParticipantInstance.fetchc                 C   s$   | j j|||||||||	|
||dS )r   )rW   rx   r   r   r   r   r[   r\   r   rZ   rn   ro   )r   r   )r   rW   rx   r   r   r   r   r[   r\   r   rZ   rn   ro   r   r   r   r     s   zParticipantInstance.updatec                 C   r   )r   )r   r   r   r   r   r   r     r   zParticipantInstance.deletec                 C   r   )r   r   c                 s   r   r   r   r   r   r   r   r     r   z/ParticipantInstance.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.ParticipantInstance {}>r   r   r   r   r   r     r   zParticipantInstance.__repr__r   )r   r   r   objectr   r   propertyr   r   r   rT   ro   rn   r   r   r   rZ   rW   rx   rY   r   rH   r   r   r   r   r   r   r   r   r   r   r   rN     sX    	$














	
(	rN   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r   r   rN   r   r   r   r   <module>   s     -o