o
    �¨ÊhE  ã                   @   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ddfdd„Zejejejejejejejejejdd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fd	d
„Z	dd„ Z
dd„ Zdd„ Zdd„ Z‡  ZS )Ú	EventListú  c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a6  
        Initialize the EventList

        :param Version version: Version that contains the resource
        :param workspace_sid: The unique ID of the Workspace

        :returns: twilio.rest.taskrouter.v1.workspace.event.EventList
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventList
        Úworkspace_sidz"/Workspaces/{workspace_sid}/EventsN© )Úsuperr	   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   ©Ú	__class__r   ú[/var/www/html/env/lib/python3.10/site-packages/twilio/rest/taskrouter/v1/workspace/event.pyr      s   

zEventList.__init__Nc                 C   sH   | j  |
|¡}| j|||||||||	|d d�
}| j  ||d |d ¡S )a•  
        Streams EventInstance 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 datetime end_date: Filter events by an end date.
        :param unicode event_type: Filter events by those of a certain event type
        :param unicode minutes: Filter events by up to 'x' minutes in the past.
        :param unicode reservation_sid: Filter events by those pertaining to a particular reservation
        :param datetime start_date: Filter events by a start date.
        :param unicode task_queue_sid: Filter events by those pertaining to a particular queue
        :param unicode task_sid: Filter events by those pertaining to a particular task
        :param unicode worker_sid: Filter events by those pertaining to a particular worker
        :param unicode workflow_sid: The workflow_sid
        :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.taskrouter.v1.workspace.event.EventInstance]
        Ú	page_size)
Úend_dateÚ
event_typeÚminutesÚreservation_sidÚ
start_dateÚtask_queue_sidÚtask_sidÚ
worker_sidÚworkflow_sidr   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   r   r   r   r   r   r   r    r!   r   Úlimitsr%   r   r   r   r&   %   s   özEventList.streamc                 C   s$   t | j|||||||||	|
|d�ƒS )a5  
        Lists EventInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param datetime end_date: Filter events by an end date.
        :param unicode event_type: Filter events by those of a certain event type
        :param unicode minutes: Filter events by up to 'x' minutes in the past.
        :param unicode reservation_sid: Filter events by those pertaining to a particular reservation
        :param datetime start_date: Filter events by a start date.
        :param unicode task_queue_sid: Filter events by those pertaining to a particular queue
        :param unicode task_sid: Filter events by those pertaining to a particular task
        :param unicode worker_sid: Filter events by those pertaining to a particular worker
        :param unicode workflow_sid: The workflow_sid
        :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.taskrouter.v1.workspace.event.EventInstance]
        )r   r   r   r   r   r   r   r   r    r!   r   )Úlistr&   )r   r   r   r   r   r   r   r   r   r    r!   r   r   r   r   r(   T   s   õzEventList.listc                 C   sT   t  t |¡|||t |¡||||	|
||dœ¡}| jjd| j|d�}t| j|| jƒS )a“  
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param datetime end_date: Filter events by an end date.
        :param unicode event_type: Filter events by those of a certain event type
        :param unicode minutes: Filter events by up to 'x' minutes in the past.
        :param unicode reservation_sid: Filter events by those pertaining to a particular reservation
        :param datetime start_date: Filter events by a start date.
        :param unicode task_queue_sid: Filter events by those pertaining to a particular queue
        :param unicode task_sid: Filter events by those pertaining to a particular task
        :param unicode worker_sid: Filter events by those pertaining to a particular worker
        :param unicode workflow_sid: The workflow_sid
        :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 EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventPage
        )ÚEndDateÚ	EventTypeÚMinutesÚReservationSidÚ	StartDateÚTaskQueueSidÚTaskSidÚ	WorkerSidÚWorkflowSidÚ	PageTokenr   ÚPageSizeÚGET©Úparams)	r   Úofr   Úiso8601_datetimer#   r%   r   Ú	EventPager   )r   r   r   r   r   r   r   r   r   r    Ú
page_tokenÚpage_numberr   r6   Úresponser   r   r   r%      s(   ôýzEventList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a7  
        Retrieve a specific page of EventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventPage
        r4   )r#   ÚdomainÚtwilioÚrequestr9   r   )r   Ú
target_urlr<   r   r   r   Úget_page°   s
   

þzEventList.get_pagec                 C   ó   t | j| jd |d�S ©zÙ
        Constructs a EventContext

        :param sid: The sid

        :returns: twilio.rest.taskrouter.v1.workspace.event.EventContext
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventContext
        r   ©r   Úsid©ÚEventContextr#   r   ©r   rE   r   r   r   ÚgetÁ   ó   	zEventList.getc                 C   rB   rC   rF   rH   r   r   r   Ú__call__Ì   rJ   zEventList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z <Twilio.Taskrouter.V1.EventList>r   ©r   r   r   r   Ú__repr__×   ó   zEventList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr&   r(   r%   rA   rI   rK   rO   Ú__classcell__r   r   r   r   r	      s4    
ü/
ü+
û1r	   c                       ó0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r9   r
   c                    s   t t| ƒ ||¡ || _dS )an  
        Initialize the EventPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param workspace_sid: The unique ID of the Workspace

        :returns: twilio.rest.taskrouter.v1.workspace.event.EventPage
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventPage
        N)r   r9   r   r   )r   r   r<   Úsolutionr   r   r   r   ä   s   
zEventPage.__init__c                 C   s   t | j|| jd d�S )a  
        Build an instance of EventInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.taskrouter.v1.workspace.event.EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventInstance
        r   )r   )ÚEventInstancer#   r   )r   Úpayloadr   r   r   Úget_instanceô   rJ   zEventPage.get_instancec                 C   rL   )rM   z <Twilio.Taskrouter.V1.EventPage>r   rN   r   r   r   rO   ÿ   rP   zEventPage.__repr__)rQ   rR   rS   rT   r   r[   rO   rV   r   r   r   r   r9   á   s
    r9   c                       rW   )rG   r
   c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )aN  
        Initialize the EventContext

        :param Version version: Version that contains the resource
        :param workspace_sid: The workspace_sid
        :param sid: The sid

        :returns: twilio.rest.taskrouter.v1.workspace.event.EventContext
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventContext
        rD   z(/Workspaces/{workspace_sid}/Events/{sid}Nr   )r   rG   r   r   r   r   )r   r   r   rE   r   r   r   r     s   zEventContext.__init__c                 C   s<   t  i ¡}| jjd| j|d�}t| j|| jd | jd d�S )ú˜
        Fetch a EventInstance

        :returns: Fetched EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventInstance
        r4   r5   r   rE   rD   )r   r7   r#   Úfetchr   rY   r   )r   r6   rZ   r   r   r   r]     s   
ýüzEventContext.fetchc                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rM   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>:  ó   € z(EventContext.__repr__.<locals>.<genexpr>z&<Twilio.Taskrouter.V1.EventContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rO   3  ó   
zEventContext.__repr__)rQ   rR   rS   rT   r   r]   rO   rV   r   r   r   r   rG   	  s
    rG   c                       sò   e Zd Zd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ed#d$„ ƒZd%d&„ Zd'd(„ Z‡  ZS )*rY   r
   Nc                    s˜   t t| ƒ |¡ |d |d |d |d |d |d t |d ¡|d |d	 |d
 |d |d |d |d |d dœ| _d| _||pF| jd dœ| _dS )zÁ
        Initialize the EventInstance

        :returns: twilio.rest.taskrouter.v1.workspace.event.EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventInstance
        Úaccount_sidÚ	actor_sidÚ
actor_typeÚ	actor_urlÚdescriptionÚ
event_dataÚ
event_dater   Úresource_sidÚresource_typeÚresource_urlrE   ÚsourceÚsource_ip_addressÚurl)ro   rp   rq   rr   rs   rt   ru   r   rv   rw   rx   rE   ry   rz   r{   NrD   )r   rY   r   r   r8   Ú_propertiesÚ_contextr   )r   r   rZ   r   rE   r   r   r   r   A  s&   ñzEventInstance.__init__c                 C   s.   | j du rt| j| jd | jd d�| _ | j S )a-  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: EventContext for this EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventContext
        Nr   rE   rD   )r}   rG   r#   r   rN   r   r   r   Ú_proxya  s   
	ýzEventInstance._proxyc                 C   ó
   | j d S )zQ
        :returns: The account owning this event
        :rtype: unicode
        ro   ©r|   rN   r   r   r   ro   r  ó   
zEventInstance.account_sidc                 C   r   )zA
        :returns: The actor_sid
        :rtype: unicode
        rp   r€   rN   r   r   r   rp   z  r�   zEventInstance.actor_sidc                 C   r   )zB
        :returns: The actor_type
        :rtype: unicode
        rq   r€   rN   r   r   r   rq   ‚  r�   zEventInstance.actor_typec                 C   r   )zA
        :returns: The actor_url
        :rtype: unicode
        rr   r€   rN   r   r   r   rr   Š  r�   zEventInstance.actor_urlc                 C   r   )zN
        :returns: A description of the event
        :rtype: unicode
        rs   r€   rN   r   r   r   rs   ’  r�   zEventInstance.descriptionc                 C   r   )zS
        :returns: Data about this specific event.
        :rtype: unicode
        rt   r€   rN   r   r   r   rt   š  r�   zEventInstance.event_datac                 C   r   )zQ
        :returns: The time this event was sent
        :rtype: datetime
        ru   r€   rN   r   r   r   ru   ¢  r�   zEventInstance.event_datec                 C   r   )zP
        :returns: An identifier for this event
        :rtype: unicode
        r   r€   rN   r   r   r   r   ª  r�   zEventInstance.event_typec                 C   r   )zh
        :returns: The sid of the object this event is most relevant to
        :rtype: unicode
        rv   r€   rN   r   r   r   rv   ²  r�   zEventInstance.resource_sidc                 C   r   )ze
        :returns: The type of object this event is most relevant to
        :rtype: unicode
        rw   r€   rN   r   r   r   rw   º  r�   zEventInstance.resource_typec                 C   r   )zD
        :returns: The resource_url
        :rtype: unicode
        rx   r€   rN   r   r   r   rx   Â  r�   zEventInstance.resource_urlc                 C   r   )z;
        :returns: The sid
        :rtype: unicode
        rE   r€   rN   r   r   r   rE   Ê  r�   zEventInstance.sidc                 C   r   )z>
        :returns: The source
        :rtype: unicode
        ry   r€   rN   r   r   r   ry   Ò  r�   zEventInstance.sourcec                 C   r   )zI
        :returns: The source_ip_address
        :rtype: unicode
        rz   r€   rN   r   r   r   rz   Ú  r�   zEventInstance.source_ip_addressc                 C   r   )z;
        :returns: The url
        :rtype: unicode
        r{   r€   rN   r   r   r   r{   â  r�   zEventInstance.urlc                 C   s
   | j  ¡ S )r\   )r~   r]   rN   r   r   r   r]   ê  s   
zEventInstance.fetchc                 C   r^   )rM   r_   c                 s   r`   ra   rb   rc   r   r   r   rg   ú  rh   z)EventInstance.__repr__.<locals>.<genexpr>z'<Twilio.Taskrouter.V1.EventInstance {}>ri   rl   r   r   r   rO   ó  rn   zEventInstance.__repr__)N)rQ   rR   rS   rT   r   Úpropertyr~   ro   rp   rq   rr   rs   rt   ru   r   rv   rw   rx   rE   ry   rz   r{   r]   rO   rV   r   r   r   r   rY   >  sJ     















	rY   N)rT   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r9   rG   rY   r   r   r   r   Ú<module>   s    P(5