a
    !f9                     @   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 )MetricInstancec                   @   s   e Zd ZdZdZdZdZdS )MetricInstance.StreamDirectionunknownZinboundZoutboundZbothN)__name__
__module____qualname__UNKNOWNZINBOUNDZOUTBOUNDZBOTH r   r   d/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/insights/v1/call/metric.pyStreamDirection   s   r   c                   @   s    e Zd ZdZdZdZdZdZdS )MetricInstance.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|i| _d S )
N	timestampr    account_sidedge	directionr   r   r   r   )super__init__getr!   r    r"   r#   r$   r   r   r   r   	_solution)selfr   r   r    	__class__r   r   r&   3   s    zMetricInstance.__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>L       z*MetricInstance.__repr__.<locals>.<genexpr>z&<Twilio.Insights.V1.MetricInstance {}>)joinr(   itemsr0   )r)   contextr   r   r   __repr__F   s    zMetricInstance.__repr__)r   r   r   objectr   r   r   r   strr   r&   r9   __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 )
MetricPage)r   r-   c                 C   s   t | j|| jd dS )zl
        Build an instance of MetricInstance

        :param payload: Payload response from the API
        r    )r    )r   _versionr(   )r)   r   r   r   r   get_instanceQ   s    zMetricPage.get_instancer,   c                 C   s   dS )r.   z<Twilio.Insights.V1.MetricPage>r   r)   r   r   r   r9   [   s    zMetricPage.__repr__N)	r   r   r   r   r;   r   r   r?   r9   r   r   r   r   r=   P   s   
r=   c                       s  e Zd Zeed fddZejejddfede	f ede	f e
e e
e ee ddd	Zejejddfede	f ede	f e
e e
e ee dd
dZejejddfede	f ede	f e
e e
e ee dddZejejddfede	f ede	f e
e e
e ee dddZejejejejejfede	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ejfede	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 )
MetricList)r   r    c                    s.   t  | d|i| _djf i | j| _dS )z
        Initialize the MetricList

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

        r    z/Voice/{call_sid}/MetricsN)r%   r&   r(   r0   _uri)r)   r   r    r*   r   r   r&   e   s    zMetricList.__init__Nr   r   )r#   r$   limit	page_sizer-   c                 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 &quot;MetricInstance.TwilioEdge&quot; edge: The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :param &quot;MetricInstance.StreamDirection&quot; direction: The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`.
        :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
        rD   r#   r$   rD   rC   )r>   read_limitspagestreamr)   r#   r$   rC   rD   ZlimitsrG   r   r   r   rH   u   s    zMetricList.streamc                    s:   | j ||}| j|||d dI dH }| j ||d S )a  
        Asynchronously 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 &quot;MetricInstance.TwilioEdge&quot; edge: The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :param &quot;MetricInstance.StreamDirection&quot; direction: The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`.
        :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
        rD   rE   NrC   )r>   rF   
page_asyncstream_asyncrI   r   r   r   rK      s
    
zMetricList.stream_asyncc                 C   s   t | j||||dS )a3  
        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 &quot;MetricInstance.TwilioEdge&quot; edge: The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :param &quot;MetricInstance.StreamDirection&quot; direction: The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`.
        :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$   rC   rD   )listrH   r)   r#   r$   rC   rD   r   r   r   rM      s    zMetricList.listc                    s(   dd | j ||||dI dH 2 I dH S )aB  
        Asynchronously 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 &quot;MetricInstance.TwilioEdge&quot; edge: The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :param &quot;MetricInstance.StreamDirection&quot; direction: The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`.
        :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   )r1   recordr   r   r   
<listcomp>   s   z)MetricList.list_async.<locals>.<listcomp>rL   N)rK   rN   r   r   r   
list_async   s    
zMetricList.list_async)r#   r$   
page_tokenpage_numberrD   r-   c                 C   s:   t |||||d}| jjd| j|d}t| j|| jS )aZ  
        Retrieve a single page of MetricInstance records from the API.
        Request is executed immediately

        :param edge: The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :param direction: The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`.
        :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 MetricInstance
        EdgeZ	DirectionZ	PageTokenr   ZPageSizeGETmethoduriparams)r	   ofr>   rG   rB   r=   r(   r)   r#   r$   rR   rS   rD   dataresponser   r   r   rG      s    
zMetricList.pagec                    s@   t |||||d}| jjd| j|dI dH }t| j|| jS )ai  
        Asynchronously retrieve a single page of MetricInstance records from the API.
        Request is executed immediately

        :param edge: The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`.
        :param direction: The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`.
        :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 MetricInstance
        rT   rV   rW   N)r	   r[   r>   rJ   rB   r=   r(   r\   r   r   r   rJ     s    
zMetricList.page_async)
target_urlr-   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of MetricInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MetricInstance
        rV   )r>   domaintwiliorequestr=   r(   r)   r_   r^   r   r   r   get_page6  s    	zMetricList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a   
        Asynchronously retrieve a specific page of MetricInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MetricInstance
        rV   N)r>   r`   ra   Zrequest_asyncr=   r(   rc   r   r   r   get_page_asyncB  s    	zMetricList.get_page_asyncr,   c                 C   s   dS )r.   z<Twilio.Insights.V1.MetricList>r   r@   r   r   r   r9   N  s    zMetricList.__repr__)r   r   r   r   r;   r&   r	   unsetr   r:   r   intr   r   rH   r   rK   r   rM   rQ   r=   rG   rJ   rd   re   r9   r<   r   r   r*   r   rA   d   s   



!

"

#




#




#rA   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   r=   rA   r   r   r   r   <module>   s   $7