o
    �¨ÊhÐb  ã                   @   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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fdd„Zejejddfdd„Zejejddfd	d
„Z	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 )ÚParticipantListú  c                    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 unique sid that identifies this account
        :param conference_sid: A string that uniquely identifies this conference

        :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   úf/var/www/html/env/lib/python3.10/site-packages/twilio/rest/api/v2010/account/conference/participant.pyr      s   zParticipantList.__init__c           !      C   sò   t  i d|“d|“d|“d|“dt |dd„ ¡“d|“d	|“d
|“d|	“d|
“d|“d|“d|“d|“d|“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 a new ParticipantInstance

        :param unicode from_: The `from` phone number used to invite a participant.
        :param unicode to: The number, client id, or sip address of the new participant.
        :param unicode status_callback: URL for conference event callback.
        :param unicode status_callback_method: Method Twilio should use to reach the status callback URL.
        :param unicode status_callback_event: Set state change events that will trigger a callback.
        :param unicode timeout: Number of seconds Twilio will wait for an answer.
        :param bool record: Record the agent and their conferences.
        :param bool muted: Mute the agent.
        :param unicode beep: Play a beep when the participant joins the conference.
        :param bool start_conference_on_enter: Begin the conference when the participant joins.
        :param bool end_conference_on_exit: End the conference when the participant leaves.
        :param unicode wait_url: URL that hosts pre-conference hold music
        :param unicode wait_method: The method Twilio should use to request `WaitUrl`.
        :param bool early_media: Agents can hear the state of the outbound call.
        :param unicode max_participants: Maximum number of agent conference participants.
        :param unicode conference_record: Record the conference.
        :param unicode conference_trim: Trim silence from audio files.
        :param unicode conference_status_callback: Callback URL for conference events.
        :param unicode conference_status_callback_method: HTTP method for requesting `ConferenceStatusCallback` URL.
        :param unicode conference_status_callback_event: Set which conference state changes should webhook to the `ConferenceStatusCallback`
        :param unicode recording_channels: Specify `mono` or `dual` recording channels.
        :param unicode recording_status_callback: The absolute URL for Twilio's webhook with recording status information.
        :param unicode recording_status_callback_method: HTTP method for `RecordingStatusCallback`
        :param unicode sip_auth_username: SIP username used for authenticating.
        :param unicode sip_auth_password: SIP password for authentication.
        :param unicode region: The region where Twilio should mix the conference audio.
        :param unicode conference_recording_status_callback: Conference recording callback URL.
        :param unicode conference_recording_status_callback_method: Method Twilio should use to request the `ConferenceRecordingStatusCallback` URL.
        :param unicode recording_status_callback_event: Set which recording state changes should webhook to the `RecordingStatusCallback`
        :param unicode conference_recording_status_callback_event: Set which conference recording state changes should webhook to the `ConferenceRecordingStatusCallback`

        :returns: Newly created ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        ÚFromÚToÚStatusCallbackÚStatusCallbackMethodÚStatusCallbackEventc                 S   ó   | S ©Nr   ©Úer   r   r   Ú<lambda>e   ó    z(ParticipantList.create.<locals>.<lambda>ÚTimeoutÚRecordÚMutedÚBeepÚStartConferenceOnEnterÚEndConferenceOnExitÚWaitUrlÚ
WaitMethodÚ
EarlyMediaÚMaxParticipantsÚConferenceRecordÚConferenceTrimc                 S   r   r   r   r    r   r   r   r"   t   r#   c                 S   r   r   r   r    r   r   r   r"   }   r#   c                 S   r   r   r   r    r   r   r   r"   ~   r#   )ÚConferenceStatusCallbackÚConferenceStatusCallbackMethodÚConferenceStatusCallbackEventÚRecordingChannelsÚRecordingStatusCallbackÚRecordingStatusCallbackMethodÚSipAuthUsernameÚSipAuthPasswordÚRegionÚ!ConferenceRecordingStatusCallbackÚ'ConferenceRecordingStatusCallbackMethodÚRecordingStatusCallbackEventÚ&ConferenceRecordingStatusCallbackEventÚPOST©Údatar   r   r   )	r   Úofr   ÚmapÚ_versionÚcreater   ÚParticipantInstancer   )!r   Úfrom_ÚtoÚstatus_callbackÚstatus_callback_methodÚstatus_callback_eventÚ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_eventr?   Úpayloadr   r   r   rC   &   sx   :ÿþýüûúùø	÷
öõôóòñðï
â!ýüzParticipantList.createNc                 C   s:   | j  ||¡}| j|||d d�}| j  ||d |d ¡S )aZ  
        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: Filter by muted participants
        :param bool hold: Only show participants that are held or unheld.
        :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)rL   Úholdrd   ÚlimitÚ
page_limit)rB   Úread_limitsÚpageÚstream)r   rL   re   rf   rd   Úlimitsri   r   r   r   rj   Ž   s   zParticipantList.streamc                 C   s   t | j||||d�ƒS )aú  
        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: Filter by muted participants
        :param bool hold: Only show participants that are held or unheld.
        :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]
        )rL   re   rf   rd   )Úlistrj   )r   rL   re   rf   rd   r   r   r   rl   ¨   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: Filter by muted participants
        :param bool hold: Only show participants that are held or unheld.
        :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&   ÚHoldÚ	PageTokenr   ÚPageSizeÚGET©Úparams)r   r@   rB   ri   r   ÚParticipantPager   )r   rL   re   Ú
page_tokenÚpage_numberrd   rr   Úresponser   r   r   ri   ½   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
        rp   )rB   ÚdomainÚtwilioÚrequestrs   r   )r   Ú
target_urlrv   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: Fetch by unique participant Call SID

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantContext
        r   r   ©r   r   Úcall_sid©ÚParticipantContextrB   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__Ú__doc__r   r   ÚunsetrC   rj   rl   ri   r{   rƒ   r…   r‰   Ú__classcell__r   r   r   r   r	      sL    
ì
h
ÿ

ÿ
ÿr	   c                       s0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )rs   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 unique sid that identifies this account
        :param conference_sid: A string that uniquely identifies this conference

        :returns: twilio.rest.api.v2010.account.conference.participant.ParticipantPage
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantPage
        N)r   rs   r   r   )r   r   rv   Úsolutionr   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   )rD   rB   r   )r   rc   r   r   r   Úget_instance+  s   	üzParticipantPage.get_instancec                 C   r†   )r‡   z"<Twilio.Api.V2010.ParticipantPage>r   rˆ   r   r   r   r‰   ;  rŠ   zParticipantPage.__repr__)r‹   rŒ   r�   rŽ   r   r’   r‰   r�   r   r   r   r   rs     s
    rs   c                       sZ   e Zd ZdZ‡ fdd„Z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
‡  ZS )r�   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 unique sid that identifies this account
        :param conference_sid: The string that uniquely identifies this conference
        :param call_sid: Fetch by unique participant Call SID

        :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   H  s   ýzParticipantContext.__init__c                 C   sD   t  i ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )úµ
        Fetch a ParticipantInstance

        :returns: Fetched ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        rp   rq   r   r   r   r~   )r   r@   rB   Úfetchr   rD   r   )r   rr   rc   r   r   r   r”   ^  s   
ýûzParticipantContext.fetchc           	   	   C   sR   t  ||||||dœ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )áý  
        Update the ParticipantInstance

        :param bool muted: Indicates if the participant should be muted
        :param bool hold: Specifying true will hold the participant, while false will un-hold.
        :param unicode hold_url: The 'HoldUrl' attribute lets you specify a URL for music that plays when a participant is held.
        :param unicode hold_method: Specify GET or POST, defaults to GET
        :param unicode announce_url: The 'AnnounceUrl' attribute lets you specify a URL for announcing something to the participant.
        :param unicode announce_method: Specify GET or POST, defaults to POST

        :returns: Updated ParticipantInstance
        :rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
        )r&   rm   ÚHoldUrlÚ
HoldMethodÚAnnounceUrlÚAnnounceMethodr=   r>   r   r   r   r~   )r   r@   rB   Úupdater   rD   r   )	r   rL   re   Úhold_urlÚhold_methodÚannounce_urlÚannounce_methodr?   rc   r   r   r   rš   u  s(   ú	ýûzParticipantContext.updatec                 C   s   | j  d| j¡S )ú‚
        Deletes the ParticipantInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)rB   r    r   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   r�   E  s    
þ'	r�   c                       sþ   e Zd 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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‡  ZS )(rD   r
   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 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   r   r   Údate_createdÚdate_updatedrO   rL   re   rN   ÚstatusÚuri)r   r   r   r¿   rÀ   rO   rL   re   rN   rÁ   rÂ   Nr~   )r   rD   r   r   Úrfc2822_datetimeÚ_propertiesÚ_contextr   )r   r   rc   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�   rB   r   rˆ   r   r   r   Ú_proxyÜ  s   
	üzParticipantInstance._proxyc                 C   ó
   | j d S )z_
        :returns: The unique sid that identifies this account
        :rtype: unicode
        r   ©rÄ   rˆ   r   r   r   r   î  ó   
zParticipantInstance.account_sidc                 C   rÇ   )z_
        :returns: A string that uniquely identifies this call
        :rtype: unicode
        r   rÈ   rˆ   r   r   r   r   ö  rÉ   zParticipantInstance.call_sidc                 C   rÇ   )ze
        :returns: A string that uniquely identifies this conference
        :rtype: unicode
        r   rÈ   rˆ   r   r   r   r   þ  rÉ   z"ParticipantInstance.conference_sidc                 C   rÇ   )zW
        :returns: The date this resource was created
        :rtype: datetime
        r¿   rÈ   rˆ   r   r   r   r¿     rÉ   z ParticipantInstance.date_createdc                 C   rÇ   )z\
        :returns: The date this resource was last updated
        :rtype: datetime
        rÀ   rÈ   rˆ   r   r   r   rÀ     rÉ   z ParticipantInstance.date_updatedc                 C   rÇ   )z]
        :returns: Indicates if the endConferenceOnExit was set
        :rtype: bool
        rO   rÈ   rˆ   r   r   r   rO     rÉ   z*ParticipantInstance.end_conference_on_exitc                 C   rÇ   )zV
        :returns: Indicates if the participant is muted
        :rtype: bool
        rL   rÈ   rˆ   r   r   r   rL     rÉ   zParticipantInstance.mutedc                 C   rÇ   )z\
        :returns: true if this participant is currently held.
        :rtype: bool
        re   rÈ   rˆ   r   r   r   re   &  rÉ   zParticipantInstance.holdc                 C   rÇ   )zj
        :returns: Indicates if the startConferenceOnEnter attribute was set
        :rtype: bool
        rN   rÈ   rˆ   r   r   r   rN   .  rÉ   z-ParticipantInstance.start_conference_on_enterc                 C   rÇ   )zQ
        :returns: The status
        :rtype: ParticipantInstance.Status
        rÁ   rÈ   rˆ   r   r   r   rÁ   6  rÉ   zParticipantInstance.statusc                 C   rÇ   )zM
        :returns: The URI for this resource
        :rtype: unicode
        rÂ   rÈ   rˆ   r   r   r   rÂ   >  rÉ   zParticipantInstance.uric                 C   ó
   | j  ¡ S )r“   )rÆ   r”   rˆ   r   r   r   r”   F  ó   
zParticipantInstance.fetchc                 C   s   | j j||||||d�S )r•   )rL   re   r›   rœ   r�   rž   )rÆ   rš   )r   rL   re   r›   rœ   r�   rž   r   r   r   rš   O  s   úzParticipantInstance.updatec                 C   rÊ   )rŸ   )rÆ   r    rˆ   r   r   r   r    h  rË   zParticipantInstance.deletec                 C   r¡   )r‡   r¢   c                 s   r£   r¤   r¥   r¦   r   r   r   rª   x  r«   z/ParticipantInstance.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.ParticipantInstance {}>r¬   r¯   r   r   r   r‰   q  r±   zParticipantInstance.__repr__r   )r‹   rŒ   r�   rŽ   Úobjectr¾   r   ÚpropertyrÆ   r   r   r   r¿   rÀ   rO   rL   re   rN   rÁ   rÂ   r”   r   r�   rš   r    r‰   r�   r   r   r   r   rD   °  sH    	ÿ!











	
þ	rD   N)rŽ   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   rs   r�   rD   r   r   r   r   Ú<module>   s     .k