o
    e'                     @   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                       sz   e Zd ZdZ fddZejejddfddZejejddfddZejejejejejfd	d
Z	dd Z
dd Z  ZS )
MetricList 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 MetricList

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

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

zMetricList.__init__Nc                 C   s4   | j ||}| j|||d d}| j ||d S )a<  
        Streams MetricInstance 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 MetricInstance.TwilioEdge edge: The edge
        :param MetricInstance.StreamDirection direction: The direction
        :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.metric.MetricInstance]
        	page_size)edge	directionr   limit)_versionread_limitspagestream)r   r   r   r   r   limitsr   r	   r	   r   r   $   s   zMetricList.streamc                 C   s   t | j||||dS )a  
        Lists MetricInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param MetricInstance.TwilioEdge edge: The edge
        :param MetricInstance.StreamDirection direction: The direction
        :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.metric.MetricInstance]
        )r   r   r   r   )listr   )r   r   r   r   r   r	   r	   r   r   >   s   zMetricList.listc                 C   s:   t |||||d}| jjd| j|d}t| j|| jS )a;  
        Retrieve a single page of MetricInstance records from the API.
        Request is executed immediately

        :param MetricInstance.TwilioEdge edge: The edge
        :param MetricInstance.StreamDirection direction: The direction
        :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 MetricInstance
        :rtype: twilio.rest.insights.v1.call.metric.MetricPage
        )Edge	Direction	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   
MetricPager   )r   r   r   
page_tokenpage_numberr   dataresponser	   r	   r   r   S   s   zMetricList.pagec                 C   s"   | j jjd|}t| j || jS )a4  
        Retrieve a specific page of MetricInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of MetricInstance
        :rtype: twilio.rest.insights.v1.call.metric.MetricPage
        r"   )r   domaintwiliorequestr'   r   )r   
target_urlr+   r	   r	   r   get_pageo   s
   

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

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Insights.V1.MetricList>r	   r   r	   r	   r   __repr__      zMetricList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r   r   r0   r4   __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 )aN  
        Initialize the MetricPage

        :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.metric.MetricPage
        :rtype: twilio.rest.insights.v1.call.metric.MetricPage
        N)r
   r'   r   r   )r   r   r+   solutionr   r	   r   r      s   
zMetricPage.__init__c                 C   s   t | j|| jd dS )z
        Build an instance of MetricInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.insights.v1.call.metric.MetricInstance
        :rtype: twilio.rest.insights.v1.call.metric.MetricInstance
        r   )r   )MetricInstancer   r   )r   payloadr	   r	   r   get_instance   s   	zMetricPage.get_instancec                 C   r1   )r2   z<Twilio.Insights.V1.MetricPage>r	   r3   r	   r	   r   r4      r5   zMetricPage.__repr__)r6   r7   r8   r9   r   r?   r4   r;   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dd Z  ZS )r=   r   c                   @   s    e Zd ZdZdZdZdZdZdS )zMetricInstance.TwilioEdgeunknown_edgecarrier_edgesip_edgesdk_edgeclient_edgeN)r6   r7   r8   UNKNOWN_EDGECARRIER_EDGESIP_EDGESDK_EDGECLIENT_EDGEr	   r	   r	   r   
TwilioEdge   s    rJ   c                   @   s   e Zd ZdZdZdZdZdS )zMetricInstance.StreamDirectionunknowninboundoutboundbothN)r6   r7   r8   UNKNOWNINBOUNDOUTBOUNDBOTHr	   r	   r	   r   StreamDirection   s
    rS   c                    st   t t| | |d|d|d|d|d|d|d|d|d	d
	| _d| _d|i| _dS )z
        Initialize the MetricInstance

        :returns: twilio.rest.insights.v1.call.metric.MetricInstance
        :rtype: twilio.rest.insights.v1.call.metric.MetricInstance
        	timestampr   account_sidr   r   rA   rB   rC   rD   )	rT   r   rU   r   r   rA   rB   rC   rD   N)r
   r=   r   get_properties_contextr   )r   r   r>   r   r   r	   r   r      s   zMetricInstance.__init__c                 C   
   | j d S )zA
        :returns: The timestamp
        :rtype: unicode
        rT   rW   r3   r	   r	   r   rT         
zMetricInstance.timestampc                 C   rY   )z@
        :returns: The call_sid
        :rtype: unicode
        r   rZ   r3   r	   r	   r   r      r[   zMetricInstance.call_sidc                 C   rY   )zC
        :returns: The account_sid
        :rtype: unicode
        rU   rZ   r3   r	   r	   r   rU      r[   zMetricInstance.account_sidc                 C   rY   )zN
        :returns: The edge
        :rtype: MetricInstance.TwilioEdge
        r   rZ   r3   r	   r	   r   r      r[   zMetricInstance.edgec                 C   rY   )zX
        :returns: The direction
        :rtype: MetricInstance.StreamDirection
        r   rZ   r3   r	   r	   r   r      r[   zMetricInstance.directionc                 C   rY   )zA
        :returns: The carrier_edge
        :rtype: dict
        rA   rZ   r3   r	   r	   r   rA     r[   zMetricInstance.carrier_edgec                 C   rY   )z=
        :returns: The sip_edge
        :rtype: dict
        rB   rZ   r3   r	   r	   r   rB     r[   zMetricInstance.sip_edgec                 C   rY   )z=
        :returns: The sdk_edge
        :rtype: dict
        rC   rZ   r3   r	   r	   r   rC     r[   zMetricInstance.sdk_edgec                 C   rY   )z@
        :returns: The client_edge
        :rtype: dict
        rD   rZ   r3   r	   r	   r   rD      r[   zMetricInstance.client_edgec                 C   r1   )r2   z#<Twilio.Insights.V1.MetricInstance>r	   r3   r	   r	   r   r4   (  r5   zMetricInstance.__repr__)r6   r7   r8   r9   objectrJ   rS   r   propertyrT   r   rU   r   r   rA   rB   rC   rD   r4   r;   r	   r	   r   r   r=      s0    








r=   N)r9   twilio.baser   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r'   r=   r	   r	   r	   r   <module>   s   {*