a
    !fR5                     @   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                       s\   e Zd ZG dd deZG dd deZeeee	f ed fddZ
edd	d
Z  ZS )EventInstancec                   @   s    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   c/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/insights/v1/call/event.pyLevel   s
   r   c                   @   s    e Zd ZdZdZdZdZdZdS )EventInstance.TwilioEdgeZunknown_edgecarrier_edgesip_edgesdk_edgeclient_edgeN)r   r   r   ZUNKNOWN_EDGEZCARRIER_EDGEZSIP_EDGEZSDK_EDGEZCLIENT_EDGEr   r   r   r   
TwilioEdge!   s
   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'   r(   r   r   r   r   	_solution)selfr    r!   r"   	__class__r   r   r*   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       z)EventInstance.__repr__.<locals>.<genexpr>z%<Twilio.Insights.V1.EventInstance {}>)joinr,   itemsr4   )r-   contextr   r   r   __repr__I   s    zEventInstance.__repr__)r   r   r   objectr   r   r   r   strr   r*   r=   __classcell__r   r   r.   r   r      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!   r1   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   _versionr,   )r-   r!   r   r   r   get_instanceT   s    zEventPage.get_instancer0   c                 C   s   dS )r2   z<Twilio.Insights.V1.EventPage>r   r-   r   r   r   r=   ^   s    zEventPage.__repr__N)	r   r   r   r   r?   r   r   rC   r=   r   r   r   r   rA   S   s   
rA   c                       s  e Zd Zeed fddZejddfede	f e
e e
e ee dddZejddfede	f e
e e
e ee dd	d
Zejddfede	f e
e e
e ee dddZejddfede	f e
e e
e ee dddZejejejejfed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fed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dddZ  ZS )	EventList)r    r"   c                    s.   t  | d|i| _djf 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}/EventsN)r)   r*   r,   r4   _uri)r-   r    r"   r.   r   r   r*   h   s    zEventList.__init__Nr   )r%   limit	page_sizer1   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
        rH   r%   rH   rG   )rB   read_limitspagestreamr-   r%   rG   rH   ZlimitsrK   r   r   r   rL   x   s    zEventList.streamc                    s8   | 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
        rH   rI   NrG   )rB   rJ   
page_asyncstream_asyncrM   r   r   r   rO      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%   rG   rH   )listrL   r-   r%   rG   rH   r   r   r   rQ      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   )r5   recordr   r   r   
<listcomp>   s   z(EventList.list_async.<locals>.<listcomp>rP   N)rO   rR   r   r   r   
list_async   s    
zEventList.list_async)r%   
page_tokenpage_numberrH   r1   c                 C   s8   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 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
        EdgeZ	PageTokenr   ZPageSizeGETmethoduriparams)r	   ofrB   rK   rF   rA   r,   r-   r%   rV   rW   rH   dataresponser   r   r   rK      s    	zEventList.pagec                    s>   t ||||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
        rX   rZ   r[   N)r	   r_   rB   rN   rF   rA   r,   r`   r   r   r   rN     s    	zEventList.page_async)
target_urlr1   c                 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
        rZ   )rB   domaintwiliorequestrA   r,   r-   rc   rb   r   r   r   get_page'  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
        rZ   N)rB   rd   re   Zrequest_asyncrA   r,   rg   r   r   r   get_page_async3  s    	zEventList.get_page_asyncr0   c                 C   s   dS )r2   z<Twilio.Insights.V1.EventList>r   rD   r   r   r   r=   ?  s    zEventList.__repr__)r   r   r   r   r?   r*   r	   unsetr   r>   r   intr   r   rL   r   rO   r   rQ   rU   rA   rK   rN   rh   ri   r=   r@   r   r   r.   r   rE   g   s|   



 



 



 rE   N)__doc__typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   rA   rE   r   r   r   r   <module>   s   $: