o
    �¨ÊhÎ=  ã                   @   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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 )Ú	EventListú  c                    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   úN/var/www/html/env/lib/python3.10/site-packages/twilio/rest/monitor/v1/event.pyr      s   	zEventList.__init__Nc	              	   C   sB   | 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 unicode actor_sid: Only include Events initiated by this Actor
        :param unicode event_type: Only include Events of this EventType
        :param unicode resource_sid: Only include Events referring to this resource
        :param unicode source_ip_address: Only include Events that originated from this IP address
        :param datetime start_date: Only show events on or after this date
        :param datetime end_date: Only show events 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Ú
page_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 )a7  
        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 EventType
        :param unicode resource_sid: Only include Events referring to this resource
        :param unicode source_ip_address: Only include Events that originated from this IP address
        :param datetime start_date: Only show events on or after this date
        :param datetime end_date: Only show events 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$   L   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 EventType
        :param unicode resource_sid: Only include Events referring to this resource
        :param unicode source_ip_address: Only include Events that originated from this IP address
        :param datetime start_date: Only show events on or after this date
        :param datetime end_date: Only show events 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©Úparams)	r   Úofr   Úiso8601_datetimer   r!   r   Ú	EventPager   )r   r   r   r   r   r   r   Ú
page_tokenÚpage_numberr   r/   Úresponser   r   r   r!   p   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Úrequestr2   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: A 34 character string that uniquely identifies this event.

        :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__Ú__doc__r   r   Úunsetr"   r$   r!   r:   rB   rD   rH   Ú__classcell__r   r   r   r   r	      s.    

ý(

ý$
ü*r	   c                       ó0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r2   r
   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   r2   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   rM   r   rT   rH   rO   r   r   r   r   r2   Ë   s
    r2   c                       rP   )r@   r
   c                    s2   t t| ƒ |¡ d|i| _djdi | j¤Ž| _dS )a7  
        Initialize the EventContext

        :param Version version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this event.

        :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   s4   t  i ¡}| jjd| j|d�}t| j|| jd d�S )ú‹
        Fetch a EventInstance

        :returns: Fetched EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventInstance
        r-   r.   r>   r=   )r   r0   r   Úfetchr   rR   r   )r   r/   rS   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   rM   r   rV   rH   rO   r   r   r   r   r@   ò   s
    r@   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d#d$„ Zd%d&„ Z‡  ZS )(rR   r
   Nc                    s�   t t| ƒ |¡ |d |d |d |d |d t |d ¡|d |d |d	 |d
 |d |d |d |d dœ| _d| _d
|pC| 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   rR   r   r   r1   Ú_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   Ú_proxyC  s   
	zEventInstance._proxyc                 C   ó
   | j d S )z„
        :returns: A 34 character string identifying the Account for which this Event was recorded.
        :rtype: unicode
        rh   ©rq   rG   r   r   r   rh   P  ó   
zEventInstance.account_sidc                 C   rt   )z’
        :returns: If available, a 34 character string identifying the actor that caused this event. May be null.
        :rtype: unicode
        r   ru   rG   r   r   r   r   X  rv   zEventInstance.actor_sidc                 C   rt   )z\
        :returns: The type of actor that caused this event
        :rtype: unicode
        ri   ru   rG   r   r   r   ri   `  rv   zEventInstance.actor_typec                 C   rt   )zl
        :returns: A human-readable description of the event.  May be null.
        :rtype: unicode
        rj   ru   rG   r   r   r   rj   h  rv   zEventInstance.descriptionc                 C   rt   )zp
        :returns: A freeform json object encoding additional data about the event
        :rtype: dict
        rk   ru   rG   r   r   r   rk   p  rv   zEventInstance.event_datac                 C   rt   )zY
        :returns: The date-time the event was recorded
        :rtype: datetime
        rl   ru   rG   r   r   r   rl   x  rv   zEventInstance.event_datec                 C   rt   )zR
        :returns: The event's type, as a string.
        :rtype: unicode
        r   ru   rG   r   r   r   r   €  rv   zEventInstance.event_typec                 C   rt   )zu
        :returns: A 34 character string identifying the resource that was affected.
        :rtype: unicode
        r   ru   rG   r   r   r   r   ˆ  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   )zn
        :returns: A 34 character string that uniquely identifies this event.
        :rtype: unicode
        r>   ru   rG   r   r   r   r>   ˜  rv   zEventInstance.sidc                 C   rt   )a*  
        :returns: The originating system or interface that caused the event.  web for events caused by user action in the Twilio Console.  api for events caused through a request to the REST API.  twilio for events caused by an automated or internal Twilio system.
        :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   )z;
        :returns: The url
        :rtype: unicode
        ro   ru   rG   r   r   r   ro   °  rv   zEventInstance.urlc                 C   rt   )z=
        :returns: The links
        :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   rM   r   Úpropertyrs   rh   r   ri   rj   rk   rl   r   r   rm   r>   rn   r   ro   rp   rV   rH   rO   r   r   r   r   rR   !  sF    














	rR   N)rM   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r2   r@   rR   r   r   r   r   Ú<module>   s    :'/