o
    f>h6                     @   s   d Z ddlmZmZmZmZ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dS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Insights
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)InstanceResource)ListResource)Version)Pagec                       sb   e Zd ZG dd deZG dd deZ	 dedeee	f def fdd	Z
d
efddZ  ZS )EventInstancec                   @       e Zd ZdZdZdZdZdZdS )zEventInstance.LevelUNKNOWNDEBUGINFOWARNINGERRORN)__name__
__module____qualname__r   r   r   r   r    r   r   U/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/insights/v1/call/event.pyLevel       r   c                   @   r   )EventInstance.TwilioEdgeunknown_edgecarrier_edgesip_edgesdk_edgeclient_edgeN)r   r   r   UNKNOWN_EDGECARRIER_EDGESIP_EDGESDK_EDGECLIENT_EDGEr   r   r   r   
TwilioEdge!   r   r'   versionpayloadcall_sidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _d|i| _d S )N	timestampr*   account_sidedgegrouplevelnamer   r   r    r!   )super__init__getr+   r*   r,   r-   r.   r/   r0   r   r   r    r!   	_solution)selfr(   r)   r*   	__class__r   r   r2   6   s   
zEventInstance.__init__returnc                 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   s    z)EventInstance.__repr__.<locals>.<genexpr>z%<Twilio.Insights.V1.EventInstance {}>)joinr4   itemsr;   )r5   contextr   r   r   __repr__I   s   
zEventInstance.__repr__)r   r   r   objectr   r'   r   r   strr   r2   rC   __classcell__r   r   r6   r   r      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)   r8   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   _versionr4   )r5   r)   r   r   r   get_instanceU   s   zEventPage.get_instancec                 C      dS )r9   z<Twilio.Insights.V1.EventPage>r   r5   r   r   r   rC   _      zEventPage.__repr__N)	r   r   r   r   rE   r   r   rI   rC   r   r   r   r   rG   S   s    
rG   c                       s  e Zd Zdedef fddZejddfdede	f de
e d	e
e d
ee fddZejddfdede	f de
e d	e
e d
ee fddZejddfdede	f de
e d	e
e d
ee fddZejddfdede	f de
e d	e
e d
ee fddZejejejejfded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fded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fddZ  ZS ) 	EventListr(   r*   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the EventList

        :param version: Version that contains the resource
        :param call_sid: The unique SID identifier of the Call.

        r*   z/Voice/{call_sid}/EventsNr   )r1   r2   r4   r;   _uri)r5   r(   r*   r6   r   r   r2   j   s   zEventList.__init__Nr-   r   limit	page_sizer8   c                 C   s2   | 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 &quot;EventInstance.TwilioEdge&quot; edge: The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :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
        rP   r-   rP   rO   )rH   read_limitspagestreamr5   r-   rO   rP   limitsrS   r   r   r   rT   z   s   zEventList.streamc                    s:   | 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 &quot;EventInstance.TwilioEdge&quot; edge: The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :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
        rP   rQ   NrO   )rH   rR   
page_asyncstream_asyncrU   r   r   r   rX      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 &quot;EventInstance.TwilioEdge&quot; edge: The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :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-   rO   rP   )listrT   r5   r-   rO   rP   r   r   r   rZ      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 &quot;EventInstance.TwilioEdge&quot; edge: The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :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>   s
    z(EventList.list_async.<locals>.<listcomp>rY   N)rX   r[   r   r   r   
list_async   s   
zEventList.list_async
page_tokenpage_numberc                 C   sP   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 edge: The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :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
        Edge	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r	   ofrH   rS   rN   rG   r4   r5   r-   r_   r`   rP   datarn   responser   r   r   rS      s   	
zEventList.pagec                    sX   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 edge: The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :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
        ra   re   rf   rg   rh   ri   rj   N)r	   ro   rH   rW   rN   rG   r4   rp   r   r   r   rW     s   	
zEventList.page_async
target_urlc                 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
        ri   )rH   domaintwiliorequestrG   r4   r5   rs   rr   r   r   r   get_page3  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
        ri   N)rH   rt   ru   request_asyncrG   r4   rw   r   r   r   get_page_async?  s   	zEventList.get_page_asyncc                 C   rJ   )r9   z<Twilio.Insights.V1.EventList>r   rK   r   r   r   rC   K  rL   zEventList.__repr__)r   r   r   r   rE   r2   r	   unsetr   rD   r   intr   r   rT   r   rX   r   rZ   r^   rG   rS   rW   rx   rz   rC   rF   r   r   r6   r   rM   h   s    







 




&




$rM   N)__doc__typingr   r   r   r   r   r   r   twilio.baser	   twilio.base.instance_resourcer
   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rG   rM   r   r   r   r   <module>   s    $;