o
    ep'                     @   sh   d 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )values)InstanceResource)ListResource)Pagec                       sn   e Zd ZdZ fddZejddfddZejddfddZejejejejfd	d
Z	dd Z
dd Z  ZS )	EventList PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                    s2   t t| | d|i| _djdi | j| _dS )a  
        Initialize the EventList

        :param Version version: Version that contains the resource
        :param call_sid: The call_sid

        :returns: twilio.rest.insights.v1.call.event.EventList
        :rtype: twilio.rest.insights.v1.call.event.EventList
        call_sidz/Voice/{call_sid}/EventsN )superr   __init__	_solutionformat_uri)selfversionr   	__class__r	   U/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/insights/v1/call/event.pyr      s   

zEventList.__init__Nc                 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 EventInstance.TwilioEdge edge: The edge
        :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.insights.v1.call.event.EventInstance]
        	page_size)edger   limit)_versionread_limitspagestream)r   r   r   r   limitsr   r	   r	   r   r   $   s   zEventList.streamc                 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 EventInstance.TwilioEdge edge: The edge
        :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.insights.v1.call.event.EventInstance]
        )r   r   r   )listr   )r   r   r   r   r	   r	   r   r   <   s   zEventList.listc                 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 EventInstance.TwilioEdge edge: The edge
        :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.insights.v1.call.event.EventPage
        )Edge	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   	EventPager   )r   r   
page_tokenpage_numberr   dataresponser	   r	   r   r   O   s   zEventList.pagec                 C   s"   | j jjd|}t| j || jS )a0  
        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.insights.v1.call.event.EventPage
        r    )r   domaintwiliorequestr%   r   )r   
target_urlr)   r	   r	   r   get_pageh   s
   

zEventList.get_pagec                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Insights.V1.EventList>r	   r   r	   r	   r   __repr__y      zEventList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r   r   r.   r2   __classcell__r	   r	   r   r   r      s    
r   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )r%   r   c                    s   t t| || || _dS )aI  
        Initialize the EventPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param call_sid: The call_sid

        :returns: twilio.rest.insights.v1.call.event.EventPage
        :rtype: twilio.rest.insights.v1.call.event.EventPage
        N)r
   r%   r   r   )r   r   r)   solutionr   r	   r   r      s   
zEventPage.__init__c                 C   s   t | j|| jd dS )z
        Build an instance of EventInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.insights.v1.call.event.EventInstance
        :rtype: twilio.rest.insights.v1.call.event.EventInstance
        r   )r   )EventInstancer   r   )r   payloadr	   r	   r   get_instance   s   	zEventPage.get_instancec                 C   r/   )r0   z<Twilio.Insights.V1.EventPage>r	   r1   r	   r	   r   r2      r3   zEventPage.__repr__)r4   r5   r6   r7   r   r=   r2   r9   r	   r	   r   r   r%      s
    r%   c                       s   e Zd ZdZG dd deZG dd deZ 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dd Z  ZS ) r;   r   c                   @       e Zd ZdZdZdZdZdZdS )zEventInstance.TwilioEdgeunknown_edgecarrier_edgesip_edgesdk_edgeclient_edgeN)r4   r5   r6   UNKNOWN_EDGECARRIER_EDGESIP_EDGESDK_EDGECLIENT_EDGEr	   r	   r	   r   
TwilioEdge       rI   c                   @   r>   )zEventInstance.LevelUNKNOWNDEBUGINFOWARNINGERRORN)r4   r5   r6   rK   rL   rM   rN   rO   r	   r	   r	   r   Level   rJ   rP   c                    s   t t| | |d|d|d|d|d|d|d|d|d	|d
|dd| _d| _d|i| _dS )z
        Initialize the EventInstance

        :returns: twilio.rest.insights.v1.call.event.EventInstance
        :rtype: twilio.rest.insights.v1.call.event.EventInstance
        	timestampr   account_sidr   grouplevelnamer@   rA   rB   rC   )rQ   r   rR   r   rS   rT   rU   r@   rA   rB   rC   N)r
   r;   r   get_properties_contextr   )r   r   r<   r   r   r	   r   r      s   zEventInstance.__init__c                 C   
   | j d S )zA
        :returns: The timestamp
        :rtype: unicode
        rQ   rW   r1   r	   r	   r   rQ         
zEventInstance.timestampc                 C   rY   )z@
        :returns: The call_sid
        :rtype: unicode
        r   rZ   r1   r	   r	   r   r      r[   zEventInstance.call_sidc                 C   rY   )zC
        :returns: The account_sid
        :rtype: unicode
        rR   rZ   r1   r	   r	   r   rR      r[   zEventInstance.account_sidc                 C   rY   )zM
        :returns: The edge
        :rtype: EventInstance.TwilioEdge
        r   rZ   r1   r	   r	   r   r      r[   zEventInstance.edgec                 C   rY   )z=
        :returns: The group
        :rtype: unicode
        rS   rZ   r1   r	   r	   r   rS      r[   zEventInstance.groupc                 C   rY   )zI
        :returns: The level
        :rtype: EventInstance.Level
        rT   rZ   r1   r	   r	   r   rT     r[   zEventInstance.levelc                 C   rY   )z<
        :returns: The name
        :rtype: unicode
        rU   rZ   r1   r	   r	   r   rU     r[   zEventInstance.namec                 C   rY   )zA
        :returns: The carrier_edge
        :rtype: dict
        r@   rZ   r1   r	   r	   r   r@     r[   zEventInstance.carrier_edgec                 C   rY   )z=
        :returns: The sip_edge
        :rtype: dict
        rA   rZ   r1   r	   r	   r   rA     r[   zEventInstance.sip_edgec                 C   rY   )z=
        :returns: The sdk_edge
        :rtype: dict
        rB   rZ   r1   r	   r	   r   rB   $  r[   zEventInstance.sdk_edgec                 C   rY   )z@
        :returns: The client_edge
        :rtype: dict
        rC   rZ   r1   r	   r	   r   rC   ,  r[   zEventInstance.client_edgec                 C   r/   )r0   z"<Twilio.Insights.V1.EventInstance>r	   r1   r	   r	   r   r2   4  r3   zEventInstance.__repr__)r4   r5   r6   r7   objectrI   rP   r   propertyrQ   r   rR   r   rS   rT   rU   r@   rA   rB   rC   r2   r9   r	   r	   r   r   r;      s8    










r;   N)r7   twilio.baser   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r%   r;   r	   r	   r	   r   <module>   s   t*