U
    ^g%i݁                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZmZ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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Taskrouter
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       sv   e Zd ZdZdeeeef eee d fddZ	e
dddd	Zd dd
dZd dddZedddZ  ZS )EventInstancea  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource.
    :ivar actor_sid: The SID of the resource that triggered the event.
    :ivar actor_type: The type of resource that triggered the event.
    :ivar actor_url: The absolute URL of the resource that triggered the event.
    :ivar description: A description of the event.
    :ivar event_data: Data about the event. For more information, see [Event types](https://www.twilio.com/docs/taskrouter/api/event#event-types).
    :ivar event_date: The time the event was sent, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar event_date_ms: The time the event was sent in milliseconds.
    :ivar event_type: The identifier for the event.
    :ivar resource_sid: The SID of the object the event is most relevant to, such as a TaskSid, ReservationSid, or a  WorkerSid.
    :ivar resource_type: The type of object the event is most relevant to, such as a Task, Reservation, or a Worker).
    :ivar resource_url: The URL of the resource the event is most relevant to.
    :ivar sid: The unique string that we created to identify the Event resource.
    :ivar source: Where the Event originated.
    :ivar source_ip_address: The IP from which the Event originated.
    :ivar url: The absolute URL of the Event resource.
    :ivar workspace_sid: The SID of the Workspace that contains the Event.
    N)versionpayloadworkspace_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _t	
|d| _|d| _|d	| _|d
| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _||p| jd| _d | _d S )Naccount_sid	actor_sid
actor_type	actor_urldescription
event_data
event_dateevent_date_ms
event_typeresource_sidresource_typeresource_urlr   sourcesource_ip_addressurlr   r   r   )super__init__getr   r   r   r   r   r   r
   iso8601_datetimer   r   r   r    r!   r"   r   r#   r$   r%   r   	_solution_context)selfr   r   r   r   	__class__ h/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/taskrouter/v1/workspace/event.pyr(   .   s0    zEventInstance.__init__EventContextreturnc                 C   s.   | j dkr(t| j| jd | jd d| _ | j S )z
        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
        Nr   r   r&   )r,   r2   _versionr+   r-   r0   r0   r1   _proxyQ   s    
zEventInstance._proxyc                 C   s
   | j  S )W
        Fetch the EventInstance


        :returns: The fetched EventInstance
        )r7   fetchr6   r0   r0   r1   r9   a   s    zEventInstance.fetchc                    s   | j  I dH S )q
        Asynchronous coroutine to fetch the EventInstance


        :returns: The fetched EventInstance
        N)r7   fetch_asyncr6   r0   r0   r1   r;   j   s    zEventInstance.fetch_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr0   r0   r1   	<genexpr>y   s     z)EventInstance.__repr__.<locals>.<genexpr>z'<Twilio.Taskrouter.V1.EventInstance {}>joinr+   itemsr@   r-   contextr0   r0   r1   __repr__s   s    zEventInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r(   propertyr7   r9   r;   rK   __classcell__r0   r0   r.   r1   r      s    
#		r   c                       sP   e Zd Zeeed fddZedddZedddZedd	d
Z	  Z
S )r2   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )z
        Initialize the EventContext

        :param version: Version that contains the resource
        :param workspace_sid: The SID of the Workspace with the Event to fetch.
        :param sid: The SID of the Event resource to fetch.
        r&   z(/Workspaces/{workspace_sid}/Events/{sid}Nr'   r(   r+   r@   _uri)r-   r   r   r   r.   r0   r1   r(      s
    zEventContext.__init__r3   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r8   application/jsonAcceptGETmethoduriheadersr   r   r&   )r   ofr5   r9   rT   r   r+   r-   r[   r   r0   r0   r1   r9      s    
zEventContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r:   rU   rV   rW   rX   Nr   r   r&   )r   r\   r5   r;   rT   r   r+   r]   r0   r0   r1   r;      s    
  zEventContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r<   r=   c                 s   s   | ]\}}d  ||V  qdS r>   r?   rA   r0   r0   r1   rE      s     z(EventContext.__repr__.<locals>.<genexpr>z&<Twilio.Taskrouter.V1.EventContext {}>rF   rI   r0   r0   r1   rK      s    zEventContext.__repr__)rL   rM   rN   r   rP   r(   r   r9   r;   rK   rR   r0   r0   r.   r1   r2   }   s   r2   c                   @   s2   e Zd Zeeef edddZedddZdS )	EventPage)r   r4   c                 C   s   t | j|| jd dS )zk
        Build an instance of EventInstance

        :param payload: Payload response from the API
        r   )r   )r   r5   r+   )r-   r   r0   r0   r1   get_instance   s
      zEventPage.get_instancer3   c                 C   s   dS )r<   z <Twilio.Taskrouter.V1.EventPage>r0   r6   r0   r0   r1   rK      s    zEventPage.__repr__N)	rL   rM   rN   r   rP   r   r   r_   rK   r0   r0   r0   r1   r^      s   
r^   c                       s  e Zd Zee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ddfee	e
f eee
f eee
f eee
f ee	e
f eee
f eee
f eee
f eee
f eee
f eee
f ee ee ee d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ddfee	e
f eee
f eee
f eee
f ee	e
f eee
f eee
f eee
f eee
f eee
f eee
f ee ee ee d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ddfee	e
f eee
f eee
f eee
f ee	e
f eee
f eee
f eee
f eee
f eee
f eee
f ee ee ee d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ddfee	e
f eee
f eee
f eee
f ee	e
f eee
f eee
f eee
f eee
f eee
f eee
f ee ee ee d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fee	e
f eee
f eee
f eee
f ee	e
f eee
f eee
f eee
f eee
f eee
f eee
f eee
f eee
f eee
f ed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fee	e
f eee
f eee
f eee
f ee	e
f eee
f eee
f eee
f eee
f eee
f eee
f eee
f eee
f eee
f edddZeedddZeedddZeedddZeedddZedddZ  ZS ) 	EventList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the EventList

        :param version: Version that contains the resource
        :param workspace_sid: The SID of the Workspace with the Events to read. Returns only the Events that pertain to the specified Workspace.

        r   z"/Workspaces/{workspace_sid}/EventsNrS   )r-   r   r   r.   r0   r1   r(      s
     zEventList.__init__N)end_dater   minutesreservation_sid
start_datetask_queue_sidtask_sid
worker_sidworkflow_sidtask_channelr   limit	page_sizer4   c                 C   sF   | j ||}| j|||||||||	|
||d d}| j ||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: Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time.
        :param str event_type: The type of Events to read. Returns only Events of the type specified.
        :param int minutes: The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted.
        :param str reservation_sid: The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation.
        :param datetime start_date: Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted.
        :param str task_queue_sid: The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue.
        :param str task_sid: The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task.
        :param str worker_sid: The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker.
        :param str workflow_sid: The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow.
        :param str task_channel: The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel.
        :param str sid: The SID of the Event resource to read.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        rk   ra   r   rb   rc   rd   re   rf   rg   rh   ri   r   rk   rj   )r5   read_limitspagestreamr-   ra   r   rb   rc   rd   re   rf   rg   rh   ri   r   rj   rk   Zlimitsrn   r0   r0   r1   ro      s     *zEventList.streamc                    sL   | j ||}| j|||||||||	|
||d dI dH }| j ||d S )a	  
        Asynchronously 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: Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time.
        :param str event_type: The type of Events to read. Returns only Events of the type specified.
        :param int minutes: The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted.
        :param str reservation_sid: The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation.
        :param datetime start_date: Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted.
        :param str task_queue_sid: The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue.
        :param str task_sid: The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task.
        :param str worker_sid: The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker.
        :param str workflow_sid: The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow.
        :param str task_channel: The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel.
        :param str sid: The SID of the Event resource to read.
        :param limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        rk   rl   Nrj   )r5   rm   
page_asyncstream_asyncrp   r0   r0   r1   rr   )  s     *zEventList.stream_asyncc                 C   s(   t | j|||||||||	|
|||dS )a	  
        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: Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time.
        :param str event_type: The type of Events to read. Returns only Events of the type specified.
        :param int minutes: The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted.
        :param str reservation_sid: The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation.
        :param datetime start_date: Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted.
        :param str task_queue_sid: The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue.
        :param str task_sid: The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task.
        :param str worker_sid: The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker.
        :param str workflow_sid: The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow.
        :param str task_channel: The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel.
        :param str sid: The SID of the Event resource to read.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        ra   r   rb   rc   rd   re   rf   rg   rh   ri   r   rj   rk   )listro   r-   ra   r   rb   rc   rd   re   rf   rg   rh   ri   r   rj   rk   r0   r0   r1   rt   e  s"    )zEventList.listc                    s:   dd | j |||||||||	|
|||dI dH 2 I dH S )a	  
        Asynchronously 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: Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time.
        :param str event_type: The type of Events to read. Returns only Events of the type specified.
        :param int minutes: The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted.
        :param str reservation_sid: The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation.
        :param datetime start_date: Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted.
        :param str task_queue_sid: The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue.
        :param str task_sid: The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task.
        :param str worker_sid: The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker.
        :param str workflow_sid: The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow.
        :param str task_channel: The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel.
        :param str sid: The SID of the Event resource to read.
        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S )Nr0   )rB   recordr0   r0   r1   
<listcomp>  s   z(EventList.list_async.<locals>.<listcomp>rs   N)rr   ru   r0   r0   r1   
list_async  s"    )
zEventList.list_async)ra   r   rb   rc   rd   re   rf   rg   rh   ri   r   
page_tokenpage_numberrk   r4   c                 C   sp   t t||||t|||||	|
||||d}t ddi}d|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 end_date: Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time.
        :param event_type: The type of Events to read. Returns only Events of the type specified.
        :param minutes: The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted.
        :param reservation_sid: The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation.
        :param start_date: Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted.
        :param task_queue_sid: The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue.
        :param task_sid: The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task.
        :param worker_sid: The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker.
        :param workflow_sid: The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow.
        :param task_channel: The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel.
        :param sid: The SID of the Event resource to read.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of EventInstance
        ZEndDateZ	EventTypeZMinutesZReservationSidZ	StartDateZTaskQueueSidZTaskSidZ	WorkerSidZWorkflowSidZTaskChannelZSidZ	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrU   rV   rW   rY   rZ   paramsr[   )	r   r\   r   r*   r5   rn   rT   r^   r+   r-   ra   r   rb   rc   rd   re   rf   rg   rh   ri   r   ry   rz   rk   datar[   responser0   r0   r1   rn     s4    &   zEventList.pagec                    sv   t t||||t|||||	|
||||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param end_date: Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time.
        :param event_type: The type of Events to read. Returns only Events of the type specified.
        :param minutes: The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted.
        :param reservation_sid: The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation.
        :param start_date: Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted.
        :param task_queue_sid: The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue.
        :param task_sid: The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task.
        :param worker_sid: The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker.
        :param workflow_sid: The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow.
        :param task_channel: The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel.
        :param sid: The SID of the Event resource to read.
        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of EventInstance
        r{   r|   r}   rU   rV   rW   r~   N)	r   r\   r   r*   r5   rq   rT   r^   r+   r   r0   r0   r1   rq     s4    &   zEventList.page_async)
target_urlr4   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of EventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EventInstance
        rW   )r5   domaintwiliorequestr^   r+   r-   r   r   r0   r0   r1   get_page`  s    	zEventList.get_pagec                    s(   | j jjd|I dH }t| j || jS )z
        Asynchronously retrieve a specific page of EventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EventInstance
        rW   N)r5   r   r   Zrequest_asyncr^   r+   r   r0   r0   r1   get_page_asyncl  s    	zEventList.get_page_async)r   r4   c                 C   s   t | j| jd |dS zh
        Constructs a EventContext

        :param sid: The SID of the Event resource to fetch.
        r   r&   r2   r5   r+   r-   r   r0   r0   r1   r)   x  s
      zEventList.getc                 C   s   t | j| jd |dS r   r   r   r0   r0   r1   __call__  s
      zEventList.__call__r3   c                 C   s   dS )r<   z <Twilio.Taskrouter.V1.EventList>r0   r6   r0   r0   r1   rK     s    zEventList.__repr__)rL   rM   rN   r   rP   r(   r   unsetr   r   objectintr   r   r   ro   r	   rr   r   rt   rx   r^   rn   rq   r   r   r2   r)   r   rK   rR   r0   r0   r.   r1   r`      sp  










>










>










=










>













D













B

r`   N)rO   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r2   r^   r`   r0   r0   r0   r1   <module>   s   $dI