o
    f>he                     @   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 - Monitor
    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                       sn   e Zd ZdZ	ddedeeef dee f fddZ	e
dd
dZdddZdddZdef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 actor that caused the event, if available. This can be either a User ID (matching the pattern `^US[0-9a-fA-F]{32}$`) or an Account SID (matching the pattern `^AC[0-9a-fA-F]{32}$`). If the actor's SID isn't available, this field will be `null`.
    :ivar actor_type: The type of actor that caused the event. Can be: `user` for a change made by a logged-in user in the Twilio Console, `account` for an event caused by an API request by an authenticating Account, `twilio-admin` for an event caused by a Twilio employee, and so on.
    :ivar description: A description of the event. Can be `null`.
    :ivar event_data: An object with additional data about the event. The  contents depend on `event_type`. For example, event-types of the form `RESOURCE.updated`, this value contains a `resource_properties` dictionary that describes the previous and updated properties of the resource.
    :ivar event_date: The date and time in GMT when the event was recorded specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar event_type: The event's type. Event-types are typically in the form: `RESOURCE_TYPE.ACTION`, where `RESOURCE_TYPE` is the type of resource that was affected and `ACTION` is what happened to it. For example, `phone-number.created`. For a full list of all event-types, see the [Monitor Event Types](https://www.twilio.com/docs/usage/monitor-events#event-types).
    :ivar resource_sid: The SID of the resource that was affected.
    :ivar resource_type: The type of resource that was affected. For a full list of all resource-types, see the [Monitor Event Types](https://www.twilio.com/docs/usage/monitor-events#event-types).
    :ivar sid: The unique string that we created to identify the Event resource.
    :ivar source: The originating system or interface that caused the event.  Can be: `web` for events caused by user action in the Twilio Console, `api` for events caused by a request to our API, or   `twilio` for events caused by an automated or internal Twilio system.
    :ivar source_ip_address: The IP address of the source, if the source is outside the Twilio cloud. This value is `null` for events with `source` of `twilio`
    :ivar url: The absolute URL of the resource that was affected. Can be `null`.
    :ivar links: The absolute URLs of related resources.
    Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
|d| _|d| _|d	| _|d
| _|d| _|d| _|d| _|d| _d
|pb| ji| _d | _d S )Naccount_sid	actor_sid
actor_typedescription
event_data
event_date
event_typeresource_sidresource_typer   sourcesource_ip_addressurllinks)super__init__getr   r   r   r   r   r
   iso8601_datetimer   r   r   r   r   r   r    r!   r"   	_solution_context)selfr   r   r   	__class__ O/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/monitor/v1/event.pyr$   +   s(   

zEventInstance.__init__returnEventContextc                 C   s&   | j du rt| j| 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/   _versionr'   r)   r,   r,   r-   _proxyF   s   
zEventInstance._proxyc                 C   s
   | j  S )W
        Fetch the EventInstance


        :returns: The fetched EventInstance
        )r3   fetchr2   r,   r,   r-   r5   U   s   
zEventInstance.fetchc                    s   | j  I dH S )q
        Asynchronous coroutine to fetch the EventInstance


        :returns: The fetched EventInstance
        N)r3   fetch_asyncr2   r,   r,   r-   r7   ^   s   zEventInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr,   r,   r-   	<genexpr>m       z)EventInstance.__repr__.<locals>.<genexpr>z$<Twilio.Monitor.V1.EventInstance {}>joinr'   itemsr>   r)   contextr,   r,   r-   __repr__g      
zEventInstance.__repr__N)r.   r/   )r.   r   )__name__
__module____qualname____doc__r   r   strr   r   r$   propertyr3   r5   r7   rJ   __classcell__r,   r,   r*   r-   r      s    


		r   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )r/   r   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the EventContext

        :param version: Version that contains the resource
        :param sid: The SID of the Event resource to fetch.
        r   z/Events/{sid}Nr,   )r#   r$   r'   r>   _uri)r)   r   r   r*   r,   r-   r$   s   s   zEventContext.__init__r.   c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r4   application/jsonAcceptGETmethoduriheadersr   r0   )r   ofr1   r5   rT   r   r'   r)   r[   r   r,   r,   r-   r5      s   
zEventContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r6   rU   rV   rW   rX   Nr   r0   )r   r\   r1   r7   rT   r   r'   r]   r,   r,   r-   r7      s   
zEventContext.fetch_asyncc                 C   r8   )r9   r:   c                 s   r;   r<   r=   r?   r,   r,   r-   rC      rD   z(EventContext.__repr__.<locals>.<genexpr>z#<Twilio.Monitor.V1.EventContext {}>rE   rH   r,   r,   r-   rJ      rK   zEventContext.__repr__)rM   rN   rO   r   rQ   r$   r   r5   r7   rJ   rS   r,   r,   r*   r-   r/   q   s
    r/   c                   @   s4   e Zd Zdeeef defddZdefddZdS )	EventPager   r.   c                 C   s   t | j|S )zk
        Build an instance of EventInstance

        :param payload: Payload response from the API
        )r   r1   )r)   r   r,   r,   r-   get_instance   s   zEventPage.get_instancec                 C      dS )r9   z<Twilio.Monitor.V1.EventPage>r,   r2   r,   r,   r-   rJ         zEventPage.__repr__N)	rM   rN   rO   r   rQ   r   r   r_   rJ   r,   r,   r,   r-   r^      s    r^   c                       s  e Zd Zdef fddZejejejejejejddfdeee	f deee	f deee	f deee	f d	ee
e	f d
ee
e	f dee dee dee fddZejejejejejejddfdeee	f deee	f deee	f deee	f d	ee
e	f d
ee
e	f dee dee dee fddZejejejejejejddfdeee	f deee	f deee	f deee	f d	ee
e	f d
ee
e	f dee dee dee fddZejejejejejejddfdeee	f deee	f deee	f deee	f d	ee
e	f d
ee
e	f dee dee dee fddZejejejejejejejejejf	deee	f deee	f deee	f deee	f d	ee
e	f d
ee
e	f deee	f deee	f deee	f defddZejejejejejejejejejf	deee	f deee	f deee	f deee	f d	ee
e	f d
ee
e	f deee	f deee	f deee	f defddZdedefddZdedefdd Zd!edefd"d#Zd!edefd$d%Zdefd&d'Z  ZS )(	EventListr   c                    s   t  | d| _dS )zg
        Initialize the EventList

        :param version: Version that contains the resource

        z/EventsN)r#   r$   rT   )r)   r   r*   r,   r-   r$      s   
zEventList.__init__Nr   r   r   r    
start_dateend_datelimit	page_sizer.   c	              	   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 str actor_sid: Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
        :param str event_type: Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
        :param str resource_sid: Only include events that refer to this resource. Useful for discovering the history of a specific resource.
        :param str source_ip_address: Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
        :param datetime start_date: Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :param datetime end_date: Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :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
        rf   r   r   r   r    rc   rd   rf   re   )r1   read_limitspagestreamr)   r   r   r   r    rc   rd   re   rf   limitsri   r,   r,   r-   rj      s    
zEventList.streamc	              	      sD   | j ||}	| j|||||||	d dI dH }
| j |
|	d S )a0  
        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 str actor_sid: Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
        :param str event_type: Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
        :param str resource_sid: Only include events that refer to this resource. Useful for discovering the history of a specific resource.
        :param str source_ip_address: Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
        :param datetime start_date: Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :param datetime end_date: Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :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
        rf   rg   Nre   )r1   rh   
page_asyncstream_asyncrk   r,   r,   r-   rn     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 str actor_sid: Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
        :param str event_type: Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
        :param str resource_sid: Only include events that refer to this resource. Useful for discovering the history of a specific resource.
        :param str source_ip_address: Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
        :param datetime start_date: Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :param datetime end_date: Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :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
        r   r   r   r    rc   rd   re   rf   )listrj   	r)   r   r   r   r    rc   rd   re   rf   r,   r,   r-   rp   0  s   zEventList.listc	           	         s2   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 str actor_sid: Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
        :param str event_type: Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
        :param str resource_sid: Only include events that refer to this resource. Useful for discovering the history of a specific resource.
        :param str source_ip_address: Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
        :param datetime start_date: Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :param datetime end_date: Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :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 rL   r,   )r@   recordr,   r,   r-   
<listcomp>{  s
    z(EventList.list_async.<locals>.<listcomp>ro   N)rn   rq   r,   r,   r-   
list_async\  s   
zEventList.list_async
page_tokenpage_numberc
                 C   sb   t ||||t|t||||	d	}
t ddi}d|d< | jjd| j|
|d}t| j|S )a  
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param actor_sid: Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
        :param event_type: Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
        :param resource_sid: Only include events that refer to this resource. Useful for discovering the history of a specific resource.
        :param source_ip_address: Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
        :param start_date: Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :param end_date: Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :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
        	ActorSid	EventTypeResourceSidSourceIpAddress	StartDateEndDate	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrU   rV   rW   rY   rZ   paramsr[   )r   r\   r   r&   r1   ri   rT   r^   r)   r   r   r   r    rc   rd   ru   rv   rf   datar[   responser,   r,   r-   ri     s$   
zEventList.pagec
                    sj   t ||||t|t||||	d	}
t ddi}d|d< | jjd| j|
|dI dH }t| j|S )	a"  
        Asynchronously retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param actor_sid: Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
        :param event_type: Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
        :param resource_sid: Only include events that refer to this resource. Useful for discovering the history of a specific resource.
        :param source_ip_address: Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
        :param start_date: Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :param end_date: Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        :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
        rw   r   r   rU   rV   rW   r   N)r   r\   r   r&   r1   rm   rT   r^   r   r,   r,   r-   rm     s&   
zEventList.page_async
target_urlc                 C   s   | j jjd|}t| 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   )r1   domaintwiliorequestr^   r)   r   r   r,   r,   r-   get_page  s   	zEventList.get_pagec                    s&   | j jjd|I dH }t| 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)r1   r   r   request_asyncr^   r   r,   r,   r-   get_page_async  s   	zEventList.get_page_asyncr   c                 C      t | j|dS zh
        Constructs a EventContext

        :param sid: The SID of the Event resource to fetch.
        r0   r/   r1   r)   r   r,   r,   r-   r%        zEventList.getc                 C   r   r   r   r   r,   r,   r-   __call__  r   zEventList.__call__c                 C   r`   )r9   z<Twilio.Monitor.V1.EventList>r,   r2   r,   r,   r-   rJ     ra   zEventList.__repr__)rM   rN   rO   r   r$   r   unsetr   rQ   objectr   r   intr   r   rj   r	   rn   r   rp   rt   r^   ri   rm   r   r   r/   r%   r   rJ   rS   r,   r,   r*   r-   rb      s^   





	

/





	

/





	

.





	

/







	


5







	


3rb   N)rP   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r/   r^   rb   r,   r,   r,   r-   <module>   s    $XE