o
    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 fddZ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ddfddZ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 )	EventListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the EventList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.monitor.v1.event.EventList
        :rtype: twilio.rest.monitor.v1.event.EventList
        z/EventsN )superr	   __init__	_solutionformat_uri)selfversion	__class__r
   O/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/monitor/v1/event.pyr      s   	zEventList.__init__Nc	              	   C   s<   | 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 unicode actor_sid: Only include events initiated by this Actor
        :param unicode event_type: Only include events of this Event Type
        :param unicode resource_sid: Only include events that refer to this resource
        :param unicode source_ip_address: Only include events that originated from this IP address
        :param datetime start_date: Only include events that occurred on or after this date
        :param datetime end_date: Only include events that occurred on or before this date
        :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.monitor.v1.event.EventInstance]
        	page_size)	actor_sid
event_typeresource_sidsource_ip_address
start_dateend_dater   limit)_versionread_limitspagestream)r   r   r   r   r   r   r   r   r   limitsr   r
   r
   r   r    #   s   
zEventList.streamc	           	      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 unicode actor_sid: Only include events initiated by this Actor
        :param unicode event_type: Only include events of this Event Type
        :param unicode resource_sid: Only include events that refer to this resource
        :param unicode source_ip_address: Only include events that originated from this IP address
        :param datetime start_date: Only include events that occurred on or after this date
        :param datetime end_date: Only include events that occurred on or before this date
        :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.monitor.v1.event.EventInstance]
        )r   r   r   r   r   r   r   r   )listr    )	r   r   r   r   r   r   r   r   r   r
   r
   r   r"   K   s   zEventList.listc
                 C   sN   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 unicode actor_sid: Only include events initiated by this Actor
        :param unicode event_type: Only include events of this Event Type
        :param unicode resource_sid: Only include events that refer to this resource
        :param unicode source_ip_address: Only include events that originated from this IP address
        :param datetime start_date: Only include events that occurred on or after this date
        :param datetime end_date: Only include events that occurred on or before this date
        :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.monitor.v1.event.EventPage
        )	ActorSid	EventTypeResourceSidSourceIpAddress	StartDateEndDate	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   iso8601_datetimer   r   r   	EventPager   )r   r   r   r   r   r   r   
page_tokenpage_numberr   dataresponser
   r
   r   r   o   s   zEventList.pagec                 C   s"   | j jjd|}t| j || jS )a*  
        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.monitor.v1.event.EventPage
        r+   )r   domaintwiliorequestr1   r   )r   
target_urlr5   r
   r
   r   get_page   s
   

zEventList.get_pagec                 C      t | j|dS z
        Constructs a EventContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.monitor.v1.event.EventContext
        :rtype: twilio.rest.monitor.v1.event.EventContext
        sidEventContextr   r   r>   r
   r
   r   get      	zEventList.getc                 C   r;   r<   r?   rA   r
   r
   r   __call__   rC   zEventList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Monitor.V1.EventList>r
   r   r
   r
   r   __repr__      zEventList.__repr__)__name__
__module____qualname__r   r   unsetr    r"   r   r:   rB   rD   rH   __classcell__r
   r
   r   r   r	      s,    

(

$
&r	   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r1   c                    s   t t| || || _dS )a  
        Initialize the EventPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.monitor.v1.event.EventPage
        :rtype: twilio.rest.monitor.v1.event.EventPage
        N)r   r1   r   r   )r   r   r5   solutionr   r
   r   r      s   

zEventPage.__init__c                 C   s   t | j|S )z
        Build an instance of EventInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.monitor.v1.event.EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventInstance
        )EventInstancer   r   payloadr
   r
   r   get_instance   s   	zEventPage.get_instancec                 C   rE   )rF   z<Twilio.Monitor.V1.EventPage>r
   rG   r
   r
   r   rH      rI   zEventPage.__repr__)rJ   rK   rL   r   rT   rH   rN   r
   r
   r   r   r1      s    r1   c                       rO   )r@   c                    s2   t t| | d|i| _djdi | j| _dS )a*  
        Initialize the EventContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.monitor.v1.event.EventContext
        :rtype: twilio.rest.monitor.v1.event.EventContext
        r>   z/Events/{sid}Nr
   )r   r@   r   r   r   r   )r   r   r>   r   r
   r   r      s   

zEventContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the EventInstance

        :returns: The fetched EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventInstance
        r+   )r,   r-   r>   r=   )r   fetchr   rQ   r   rR   r
   r
   r   rV      s   zEventContext.fetchc                 C   $   d dd | j D }d|S )rF    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z(EventContext.__repr__.<locals>.<genexpr>z#<Twilio.Monitor.V1.EventContext {}>joinr   itemsr   r   contextr
   r
   r   rH   	     
zEventContext.__repr__)rJ   rK   rL   r   rV   rH   rN   r
   r
   r   r   r@      s    r@   c                       s   e 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d"d# Zd$d% Z  ZS )'rQ   Nc                    s   t t| | |d|d|d|d|dt|d|d|d|d	|d
|d|d|d|dd| _d| _d
|pQ| jd
 i| _dS )z
        Initialize the EventInstance

        :returns: twilio.rest.monitor.v1.event.EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventInstance
        account_sidr   
actor_typedescription
event_data
event_dater   r   resource_typer>   sourcer   urllinks)rh   r   ri   rj   rk   rl   r   r   rm   r>   rn   r   ro   rp   N)	r   rQ   r   rB   r   r0   _properties_contextr   )r   r   rS   r>   r   r
   r   r     s$   zEventInstance.__init__c                 C   s&   | j du rt| j| 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.monitor.v1.event.EventContext
        Nr>   r=   )rr   r@   r   r   rG   r
   r
   r   _proxy5  s   
	zEventInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rh   rq   rG   r
   r
   r   rh   B     
zEventInstance.account_sidc                 C   rt   )zl
        :returns: The SID of the actor that caused the event, if available
        :rtype: unicode
        r   ru   rG   r
   r
   r   r   J  rv   zEventInstance.actor_sidc                 C   rt   )z[
        :returns: The type of actor that caused the event
        :rtype: unicode
        ri   ru   rG   r
   r
   r   ri   R  rv   zEventInstance.actor_typec                 C   rt   )zN
        :returns: A description of the event
        :rtype: unicode
        rj   ru   rG   r
   r
   r   rj   Z  rv   zEventInstance.descriptionc                 C   rt   )z}
        :returns: A JSON string that represents an object with additional data about the event
        :rtype: dict
        rk   ru   rG   r
   r
   r   rk   b  rv   zEventInstance.event_datac                 C   rt   )zr
        :returns: The ISO 8601 date and time in GMT when the event was recorded
        :rtype: datetime
        rl   ru   rG   r
   r
   r   rl   j  rv   zEventInstance.event_datec                 C   rt   )zD
        :returns: The event's type
        :rtype: unicode
        r   ru   rG   r
   r
   r   r   r  rv   zEventInstance.event_typec                 C   rt   )z]
        :returns: The SID of the resource that was affected
        :rtype: unicode
        r   ru   rG   r
   r
   r   r   z  rv   zEventInstance.resource_sidc                 C   rt   )zZ
        :returns: The type of resource that was affected
        :rtype: unicode
        rm   ru   rG   r
   r
   r   rm     rv   zEventInstance.resource_typec                 C   rt   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r>   ru   rG   r
   r
   r   r>     rv   zEventInstance.sidc                 C   rt   )zm
        :returns: The originating system or interface that caused the event
        :rtype: unicode
        rn   ru   rG   r
   r
   r   rn     rv   zEventInstance.sourcec                 C   rt   )zP
        :returns: The IP address of the source
        :rtype: unicode
        r   ru   rG   r
   r
   r   r     rv   zEventInstance.source_ip_addressc                 C   rt   )zf
        :returns: The absolute URL of the resource that was affected
        :rtype: unicode
        ro   ru   rG   r
   r
   r   ro     rv   zEventInstance.urlc                 C   rt   )zZ
        :returns: The absolute URLs of related resources
        :rtype: unicode
        rp   ru   rG   r
   r
   r   rp     rv   zEventInstance.linksc                 C   s
   | j  S )rU   )rs   rV   rG   r
   r
   r   rV     s   
zEventInstance.fetchc                 C   rW   )rF   rX   c                 s   rY   rZ   r[   r\   r
   r
   r   r`     ra   z)EventInstance.__repr__.<locals>.<genexpr>z$<Twilio.Monitor.V1.EventInstance {}>rb   re   r
   r
   r   rH     rg   zEventInstance.__repr__)N)rJ   rK   rL   r   propertyrs   rh   r   ri   rj   rk   rl   r   r   rm   r>   rn   r   ro   rp   rV   rH   rN   r
   r
   r   r   rQ     sD    














	rQ   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r1   r@   rQ   r
   r
   r
   r   <module>   s    5&(