a
    !f]c                     @   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                       st   e Zd ZdZdeeeef 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 actor that caused the event, if available. Can 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
|p| 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__ ]/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/monitor/v1/event.pyr$   -   s(    
zEventInstance.__init__EventContextreturnc                 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-   _proxyH   s    
zEventInstance._proxyc                 C   s
   | j  S )W
        Fetch the EventInstance


        :returns: The fetched EventInstance
        )r4   fetchr3   r,   r,   r-   r6   W   s    zEventInstance.fetchc                    s   | j  I dH S )q
        Asynchronous coroutine to fetch the EventInstance


        :returns: The fetched EventInstance
        N)r4   fetch_asyncr3   r,   r,   r-   r8   `   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vr,   r,   r-   	<genexpr>o       z)EventInstance.__repr__.<locals>.<genexpr>z$<Twilio.Monitor.V1.EventInstance {}>joinr'   itemsr=   r)   contextr,   r,   r-   __repr__i   s    zEventInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r$   propertyr4   r6   r8   rI   __classcell__r,   r,   r*   r-   r      s    		r   c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )r.   )r   r   c                    s.   t  | d|i| _djf 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}N)r#   r$   r'   r=   _uri)r)   r   r   r*   r,   r-   r$   t   s    zEventContext.__init__r/   c                 C   s(   | j jd| jd}t| j || jd dS )r5   GETmethodurir   r1   )r2   r6   rQ   r   r'   r)   r   r,   r,   r-   r6      s    zEventContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r7   rR   rS   Nr   r1   )r2   r8   rQ   r   r'   rV   r,   r,   r-   r8      s    zEventContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r9   r:   c                 s   s   | ]\}}d  ||V  qdS r;   r<   r>   r,   r,   r-   rB      rC   z(EventContext.__repr__.<locals>.<genexpr>z#<Twilio.Monitor.V1.EventContext {}>rD   rG   r,   r,   r-   rI      s    zEventContext.__repr__)rJ   rK   rL   r   rN   r$   r   r6   r8   rI   rP   r,   r,   r*   r-   r.   s   s   r.   c                   @   s2   e Zd Zeeef edddZedddZdS )	EventPage)r   r0   c                 C   s   t | j|S )zk
        Build an instance of EventInstance

        :param payload: Payload response from the API
        )r   r2   rV   r,   r,   r-   get_instance   s    zEventPage.get_instancer/   c                 C   s   dS )r9   z<Twilio.Monitor.V1.EventPage>r,   r3   r,   r,   r-   rI      s    zEventPage.__repr__N)	rJ   rK   rL   r   rN   r   r   rX   rI   r,   r,   r,   r-   rW      s   rW   c                       sl  e Zd Zed fddZ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e ee d	ddZ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e ee d	dd	Z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e ee d	d
dZ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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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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   c                    s   t  | d| _dS )zg
        Initialize the EventList

        :param version: Version that contains the resource

        z/EventsN)r#   r$   rQ   )r)   r   r*   r,   r-   r$      s    zEventList.__init__N)	r   r   r   r    
start_dateend_datelimit	page_sizer0   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
        r]   r   r   r   r    rZ   r[   r]   r\   )r2   read_limitspagestreamr)   r   r   r   r    rZ   r[   r\   r]   Zlimitsr`   r,   r,   r-   ra      s     
zEventList.streamc	              	      sB   | 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
        r]   r^   Nr\   )r2   r_   
page_asyncstream_asyncrb   r,   r,   r-   rd      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    rZ   r[   r\   r]   )listra   	r)   r   r   r   r    rZ   r[   r\   r]   r,   r,   r-   rf   +  s    zEventList.listc	           	         s0   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 )Nr,   )r?   recordr,   r,   r-   
<listcomp>v  s   z(EventList.list_async.<locals>.<listcomp>re   N)rd   rg   r,   r,   r-   
list_asyncW  s    
zEventList.list_async)
r   r   r   r    rZ   r[   
page_tokenpage_numberr]   r0   c
                 C   sJ   t ||||t|t||||	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
        	ZActorSidZ	EventTypeZResourceSidZSourceIpAddressZ	StartDateZEndDateZ	PageTokenr   ZPageSizerR   rT   rU   params)r   ofr   r&   r2   r`   rQ   rW   r)   r   r   r   r    rZ   r[   rk   rl   r]   dataresponser,   r,   r-   r`     s    zEventList.pagec
                    sP   t ||||t|t||||	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
        rm   rR   rn   N)r   rp   r   r&   r2   rc   rQ   rW   rq   r,   r,   r-   rc     s     zEventList.page_async)
target_urlr0   c                 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
        rR   )r2   domaintwiliorequestrW   r)   rt   rs   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
        rR   N)r2   ru   rv   Zrequest_asyncrW   rx   r,   r,   r-   get_page_async  s    	zEventList.get_page_async)r   r0   c                 C   s   t | j|dS zh
        Constructs a EventContext

        :param sid: The SID of the Event resource to fetch.
        r1   r.   r2   r)   r   r,   r,   r-   r%     s    zEventList.getc                 C   s   t | j|dS r{   r|   r}   r,   r,   r-   __call__   s    zEventList.__call__r/   c                 C   s   dS )r9   z<Twilio.Monitor.V1.EventList>r,   r3   r,   r,   r-   rI     s    zEventList.__repr__)rJ   rK   rL   r   r$   r   unsetr   rN   objectr   r   intr   r   ra   r	   rd   r   rf   rj   rW   r`   rc   ry   rz   r.   r%   r~   rI   rP   r,   r,   r*   r-   rY      s   





/





/





.





/








/








/rY   N)rM   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   r.   rW   rY   r,   r,   r,   r-   <module>   s   $Y@