
    pi(;                         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	e      Z G d
 de      Z G d de      Zy)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                   p     e Zd Z G d de      Z G d de      Z	 dedeee	f   def fdZ
d	efd
Z xZS )MetricInstancec                       e Zd ZdZdZdZdZy)MetricInstance.StreamDirectionunknowninboundoutboundbothN)__name__
__module____qualname__UNKNOWNINBOUNDOUTBOUNDBOTH     e/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/insights/v1/call/metric.pyStreamDirectionr      s    r   r!   c                        e Zd ZdZdZdZdZdZy)MetricInstance.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    
TwilioEdger#       s    %%#r   r.   versionpayloadcall_sidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        d|i| _        y )
N	timestampr1   account_sidedge	directionr%   r&   r'   r(   )super__init__getr3   r1   r4   r5   r6   r%   r&   r'   r(   	_solution)selfr/   r0   r1   	__class__s       r    r8   zMetricInstance.__init__3   s    !(/K(@'.{{:'>*1++m*D;B;;v;N	EL[[F
 :A^9T5<[[5L5<[[5L8?M8R 
r   returnc                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        yw)z{}={}N)format).0kvs      r    	<genexpr>z*MetricInstance.__repr__.<locals>.<genexpr>L   s     SDAq7>>!Q/Ss   !z&<Twilio.Insights.V1.MetricInstance {}>)joinr:   itemsrB   )r;   contexts     r    __repr__zMetricInstance.__repr__F   s6     ((SDNN<P<P<RSS7>>wGGr   )r   r   r   objectr!   r.   r   r   strr   r8   rJ   __classcell__r<   s   @r    r   r      sP    & $V $

 
$sCx. 
C 
&H# Hr   r   c                   2    e Zd Zdeeef   defdZdefdZy)
MetricPager0   r=   c                 L    t        | j                  || j                  d         S )zl
        Build an instance of MetricInstance

        :param payload: Payload response from the API
        r1   )r1   )r   _versionr:   )r;   r0   s     r    get_instancezMetricPage.get_instanceR   s%     MM7T^^J-G
 	
r   c                      y)r?   z<Twilio.Insights.V1.MetricPage>r   r;   s    r    rJ   zMetricPage.__repr__\        1r   N)	r   r   r   r   rL   r   r   rS   rJ   r   r   r    rP   rP   P   s)    
DcN 
~ 
1# 1r   rP   c                       e Zd Zdedef fdZej                  ej                  ddfdede	f   dede	f   d	e
e   d
e
e   dee   f
dZej                  ej                  ddfdede	f   dede	f   d	e
e   d
e
e   dee   f
dZej                  ej                  ddfdede	f   dede	f   d	e
e   d
e
e   dee   f
dZej                  ej                  ddfdede	f   dede	f   d	e
e   d
e
e   dee   f
dZej                  ej                  ej                  ej                  ej                  fdede	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Zej                  ej                  ej                  ej                  ej                  fdede	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ZdedefdZdedefdZdefdZ xZS )
MetricListr/   r1   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the MetricList

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

        r1   z/Voice/{call_sid}/MetricsNr   )r7   r8   r:   rB   _uri)r;   r/   r1   r<   s      r    r8   zMetricList.__init__g   s@     	! 
 7/66HH	r   Nr5   r#   r6   r   limit	page_sizer=   c                     | j                   j                  ||      }| j                  |||d         }| j                   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
        r\   r5   r6   r\   r[   )rR   read_limitspagestreamr;   r5   r6   r[   r\   limitsr`   s          r    ra   zMetricList.streamw   sN    0 **5)<yydi6+CVyW}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)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
        r\   r^   Nr[   )rR   r_   
page_asyncstream_asyncrb   s          r    rf   zMetricList.stream_async   sd     0 **5)<__f[6I % 
 
 }}))$w@@	
s   7AA$Ac                 >    t        | j                  ||||            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
        r5   r6   r[   r\   )listra   )r;   r5   r6   r[   r\   s        r    ri   zMetricList.list   s.    . KK##	  
 	
r   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        rh   N)rf   )r;   r5   r6   r[   r\   records         r    
list_asynczMetricList.list_async   sZ     2 '+&7&7##	 '8 ' !
 
 !
 
 	
 
s0   =0=842
48=48=
page_tokenpage_numberc                    t        j                  |||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }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
        Edge	Direction	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r
   ofrR   r`   rZ   rP   r:   	r;   r5   r6   rm   rn   r\   datar~   responses	            r    r`   zMetricList.page   s    ( yy&'#%
 ))^-PQR.==%%diig & 
 $--4>>BBr   c                    K   t        j                  |||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	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
        rp   ru   rv   rw   rx   ry   rz   N)r
   r   rR   re   rZ   rP   r:   r   s	            r    re   zMetricList.page_async  s     ( yy&'#%
 ))^-PQR.11diig 2 
 
 $--4>>BB
s   A$B&B'&B
target_urlc                     | j                   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
        ry   )rR   domaintwiliorequestrP   r:   r;   r   r   s      r    get_pagezMetricList.get_pageB  s=     ==''..66ujI$--4>>BBr   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)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
        ry   N)rR   r   r   request_asyncrP   r:   r   s      r    get_page_asynczMetricList.get_page_asyncN  sJ      --44BB5*UU$--4>>BB Vs   4AA&Ac                      y)r?   z<Twilio.Insights.V1.MetricList>r   rU   s    r    rJ   zMetricList.__repr__Z  rV   r   )r   r   r   r   rL   r8   r
   unsetr   rK   r   intr   r   ra   r	   rf   r   ri   rl   rP   r`   re   r   r   rJ   rM   rN   s   @r    rX   rX   e   sR   I I3 I$ <B<<EK\\##';/78; 96AB; }	;
 C=; 
.	!;> <B<<EK\\##'A/78A 96ABA }	A
 C=A 
~	&AB <B<<EK\\##'
/78
 96AB
 }	

 C=
 
n	
D <B<<EK\\##'
/78
 96AB
 }	

 C=
 
n	
F <B<<EK\\)/*0,,(.%C/78%C 96AB%C #v+&	%C
 3;'%C f%%C 
%CR <B<<EK\\)/*0,,(.%C/78%C 96AB%C #v+&	%C
 3;'%C f%%C 
%CN
C3 
C: 
C
Cs 
Cz 
C1# 1r   rX   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   rP   rX   r   r   r    <module>r      sO    M L L  : 2 ' !5H% 5Hp1 1*{1 {1r   