B
    `mv                 @   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            $       s,  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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                s0   t t| | ||d| _djf | 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__ c/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/api/v2010/account/conference/participant.pyr      s    zParticipantList.__init__c'       )   )   C   s   t ||||t|dd ||||	|
||||||||||t|dd ||||||||t|dd t|dd | |!|"|#|$|%|&d&}'| jjd| j|'d}(t| j|(| jd	 | jd
 dS )a  
        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 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 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 unicode recording_status_callback_event: The recording state changes that should generate a call to `recording_status_callback`
        :param 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

        :returns: The created ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        c             S   s   | S )Nr   )er   r   r   <lambda>p       z(ParticipantList.create.<locals>.<lambda>c             S   s   | S )Nr   )r   r   r   r   r      r   c             S   s   | S )Nr   )r   r   r   r   r      r   c             S   s   | S )Nr   )r   r   r   r   r      r   )&FromToZStatusCallbackZStatusCallbackMethodZStatusCallbackEventZLabelTimeoutZRecordMutedZBeepZStartConferenceOnEnterEndConferenceOnExitWaitUrl
WaitMethodZ
EarlyMediaZMaxParticipantsZConferenceRecordZConferenceTrimZConferenceStatusCallbackZConferenceStatusCallbackMethodZConferenceStatusCallbackEventZRecordingChannelsZRecordingStatusCallbackZRecordingStatusCallbackMethodZSipAuthUsernameZSipAuthPasswordZRegionZ!ConferenceRecordingStatusCallbackZ'ConferenceRecordingStatusCallbackMethodZRecordingStatusCallbackEventZ&ConferenceRecordingStatusCallbackEventCoachingCallSidToCoachZJitterBufferSizeZByocZCallerIdZ
CallReasonZRecordingTrackPOST)methoduridatar
   r   )r
   r   )	r   ofr   map_versioncreater   ParticipantInstancer   ))r   from_toZstatus_callbackZstatus_callback_methodZstatus_callback_eventlabeltimeoutrecordmutedZbeepstart_conference_on_enterend_conference_on_exitwait_urlwait_methodZearly_mediaZmax_participantsZconference_recordZconference_trimZconference_status_callbackZ!conference_status_callback_methodZ conference_status_callback_eventZrecording_channelsZrecording_status_callbackZ recording_status_callback_methodZsip_auth_usernameZsip_auth_passwordZregionZ$conference_recording_status_callbackZ+conference_recording_status_callback_methodZrecording_status_callback_eventZ*conference_recording_status_callback_eventcoachingcall_sid_to_coachZjitter_buffer_sizeZbyocZ	caller_idZcall_reasonZrecording_trackr%   payloadr   r   r   r)   %   sZ    F
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)r0   holdr5   r8   limit)r(   Zread_limitspagestream)r   r0   r9   r5   r:   r8   Z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]
        )r0   r9   r5   r:   r8   )listr<   )r   r0   r9   r5   r:   r8   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    Z	PageTokenr   ZPageSizeGET)r#   r$   params)r   r&   r(   r;   r   ParticipantPager   )	r   r0   r9   r5   Z
page_tokenZpage_numberr8   r%   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?   )r(   domainZtwiliorequestrA   r   )r   
target_urlrB   r   r   r   get_page   s    

zParticipantList.get_pagec             C   s   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)ParticipantContextr(   r   )r   rG   r   r   r   get  s
    	zParticipantList.getc             C   s   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   rG   )rH   r(   r   )r   rG   r   r   r   __call__  s
    	zParticipantList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Api.V2010.ParticipantList>r   )r   r   r   r   __repr__#  s    zParticipantList.__repr__)__name__
__module____qualname__r   r   unsetr)   r<   r=   r;   rF   rI   rJ   rK   __classcell__r   r   )r   r   r	      sJ   `r	   c                   s,   e Zd Z fddZdd Zdd Z  ZS )rA   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   rA   r   r   )r   r   rB   Zsolution)r   r   r   r   /  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
   r   )r*   r(   r   )r   r7   r   r   r   get_instance@  s
    	zParticipantPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Api.V2010.ParticipantPage>r   )r   r   r   r   rK   P  s    zParticipantPage.__repr__)rL   rM   rN   r   rQ   rK   rP   r   r   )r   r   rA   -  s   rA   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 )rH   c                s2   t t| | |||d| _djf | 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
   r   rG   zQ/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid}.jsonN)r   rH   r   r   r   r   )r   r   r
   r   rG   )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 )z
        Fetch the ParticipantInstance

        :returns: The fetched ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        r?   )r#   r$   r
   r   rG   )r
   r   rG   )r(   fetchr   r*   r   )r   r7   r   r   r   rR   r  s    zParticipantContext.fetchc             C   s^   t |||||||||	|
||d}| jjd| j|d}t| j|| jd | jd | jd dS )a  
        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>   ZHoldUrlZ
HoldMethodZAnnounceUrlZAnnounceMethodr   r   Z
BeepOnExitr   r    r!   r"   )r#   r$   r%   r
   r   rG   )r
   r   rG   )r   r&   r(   updater   r*   r   )r   r0   r9   hold_urlhold_methodannounce_urlannounce_methodr3   r4   beep_on_exitr2   r5   r6   r%   r7   r   r   r   rS     s(    
zParticipantContext.updatec             C   s   | j jd| jdS )z
        Deletes the ParticipantInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r#   r$   )r(   deleter   )r   r   r   r   rZ     s    zParticipantContext.deletec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>  s    z.ParticipantContext.__repr__.<locals>.<genexpr>z(<Twilio.Api.V2010.ParticipantContext {}>)joinr   itemsr   )r   contextr   r   r   rK     s    zParticipantContext.__repr__)rL   rM   rN   r   rR   r   rO   rS   rZ   rK   rP   r   r   )r   r   rH   Z  s   -	rH   c                   s4  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 )-r*   c               @   s$   e Zd ZdZdZdZdZdZdZdS )zParticipantInstance.StatusZqueuedZ
connectingZringing	connectedZcompletefailedN)	rL   rM   rN   ZQUEUEDZ
CONNECTINGZRINGINGZ	CONNECTEDZCOMPLETEZFAILEDr   r   r   r   Status  s   re   Nc                s   t t| | |d|d|d|d|d|dt|dt|d|d	|d
|d|d|d|dd| _d| _|||p| 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
   rG   r-   r6   r5   r   date_createddate_updatedr2   r0   r9   r1   statusr$   )r
   rG   r-   r6   r5   r   rf   rg   r2   r0   r9   r1   rh   r$   N)r
   r   rG   )	r   r*   r   rI   r   Zrfc2822_datetime_properties_contextr   )r   r   r7   r
   r   rG   )r   r   r   r     s&    zParticipantInstance.__init__c             C   s6   | j dkr0t| 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   rG   )r
   r   rG   )rj   rH   r(   r   )r   r   r   r   _proxy  s    	
zParticipantInstance._proxyc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r
   )ri   )r   r   r   r   r
   	  s    zParticipantInstance.account_sidc             C   s
   | j d S )zg
        :returns: The SID of the Call the resource is associated with
        :rtype: unicode
        rG   )ri   )r   r   r   r   rG     s    zParticipantInstance.call_sidc             C   s
   | j d S )zQ
        :returns: The label of this participant
        :rtype: unicode
        r-   )ri   )r   r   r   r   r-     s    zParticipantInstance.labelc             C   s
   | j d S )ze
        :returns: The SID of the participant who is being `coached`
        :rtype: unicode
        r6   )ri   )r   r   r   r   r6   !  s    z%ParticipantInstance.call_sid_to_coachc             C   s
   | j d S )z^
        :returns: Indicates if the participant changed to coach
        :rtype: bool
        r5   )ri   )r   r   r   r   r5   )  s    zParticipantInstance.coachingc             C   s
   | j d S )zc
        :returns: The SID of the conference the participant is in
        :rtype: unicode
        r   )ri   )r   r   r   r   r   1  s    z"ParticipantInstance.conference_sidc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        rf   )ri   )r   r   r   r   rf   9  s    z ParticipantInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rg   )ri   )r   r   r   r   rg   A  s    z ParticipantInstance.date_updatedc             C   s
   | j d S )zh
        :returns: Whether the conference ends when the participant leaves
        :rtype: bool
        r2   )ri   )r   r   r   r   r2   I  s    z*ParticipantInstance.end_conference_on_exitc             C   s
   | j d S )zQ
        :returns: Whether the participant is muted
        :rtype: bool
        r0   )ri   )r   r   r   r   r0   Q  s    zParticipantInstance.mutedc             C   s
   | j d S )zS
        :returns: Whether the participant is on hold
        :rtype: bool
        r9   )ri   )r   r   r   r   r9   Y  s    zParticipantInstance.holdc             C   s
   | j d S )zx
        :returns: Whether the conference starts when the participant joins the conference
        :rtype: bool
        r1   )ri   )r   r   r   r   r1   a  s    z-ParticipantInstance.start_conference_on_enterc             C   s
   | j d S )zx
        :returns: The status of the participant's call in a session
        :rtype: ParticipantInstance.Status
        rh   )ri   )r   r   r   r   rh   i  s    zParticipantInstance.statusc             C   s
   | j d S )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r$   )ri   )r   r   r   r   r$   q  s    zParticipantInstance.uric             C   s
   | j  S )z
        Fetch the ParticipantInstance

        :returns: The fetched ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        )rk   rR   )r   r   r   r   rR   y  s    zParticipantInstance.fetchc             C   s$   | j j|||||||||	|
||dS )a  
        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
        )r0   r9   rT   rU   rV   rW   r3   r4   rX   r2   r5   r6   )rk   rS   )r   r0   r9   rT   rU   rV   rW   r3   r4   rX   r2   r5   r6   r   r   r   rS     s    zParticipantInstance.updatec             C   s
   | j  S )z
        Deletes the ParticipantInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rk   rZ   )r   r   r   r   rZ     s    zParticipantInstance.deletec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r[   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r\   r]   r^   r   r   r   r_     s    z/ParticipantInstance.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.ParticipantInstance {}>)r`   r   ra   r   )r   rb   r   r   r   rK     s    zParticipantInstance.__repr__)N)rL   rM   rN   objectre   r   propertyrk   r
   rG   r-   r6   r5   r   rf   rg   r2   r0   r9   r1   rh   r$   rR   r   rO   rS   rZ   rK   rP   r   r   )r   r   r*     s4   	#	#	r*   N)__doc__Ztwilio.baser   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r	   rA   rH   r*   r   r   r   r   <module>   s     -o