
    pi4S                         d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
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 G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Serverless
    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.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                   z     e Zd ZdZ	 ddedeeef   dededee   f
 fdZ	e
dd	       Zdd
ZddZdefdZ xZS )LogInstancea  
    :ivar sid: The unique string that we created to identify the Log resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Log resource.
    :ivar service_sid: The SID of the Service that the Log resource is associated with.
    :ivar environment_sid: The SID of the environment in which the log occurred.
    :ivar build_sid: The SID of the build that corresponds to the log.
    :ivar deployment_sid: The SID of the deployment that corresponds to the log.
    :ivar function_sid: The SID of the function whose invocation produced the log.
    :ivar request_sid: The SID of the request associated with the log.
    :ivar level: The log level.
    :ivar message: The log message.
    :ivar date_created: The date and time in GMT when the Log resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar url: The absolute URL of the Log resource.
    versionpayloadservice_sidenvironment_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        |j                  d
      | _        t        j                  |j                  d            | _        |j                  d      | _        |||xs | j                  d| _        d | _        y )Nr   account_sidr   r   	build_siddeployment_sidfunction_sidrequest_sidlevelmessagedate_createdurlr   r   r   )super__init__getr   r   r   r   r   r   r   r   r    r!   r   iso8601_datetimer"   r#   	_solution_context)selfr   r   r   r   r   	__class__s         s/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/serverless/v1/service/environment/log.pyr&   zLogInstance.__init__)   s    	!")++e"4*1++m*D*1++m*D.5kk:K.L(/K(@-4[[9I-J+2;;~+F*1++m*D$+KK$8
&-kk)&<0;0L0LKK'1
 #*++e"4 '.?$((

 /3    returnc                     | j                   Et        | j                  | j                  d   | j                  d   | j                  d         | _         | j                   S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: LogContext for this LogInstance
        r   r   r   r$   )r*   
LogContext_versionr)   r+   s    r-   _proxyzLogInstance._proxyI   sR     == & NN=9 $/@ ANN5)	DM }}r.   c                 6    | j                   j                         S )S
        Fetch the LogInstance


        :returns: The fetched LogInstance
        )r4   fetchr3   s    r-   r7   zLogInstance.fetchZ   s     {{  ""r.   c                 R   K   | j                   j                          d{   S 7 w)m
        Asynchronous coroutine to fetch the LogInstance


        :returns: The fetched LogInstance
        N)r4   fetch_asyncr3   s    r-   r:   zLogInstance.fetch_asyncc   s!      [[,,....s   '%'c                     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'LogInstance.__repr__.<locals>.<genexpr>r        SDAq7>>!Q/S   !z%<Twilio.Serverless.V1.LogInstance {}>joinr)   itemsrA   r+   contexts     r-   __repr__zLogInstance.__repr__l   s6     ((SDNN<P<P<RSS6==gFFr.   )N)r/   r1   )r/   r   )__name__
__module____qualname____doc__r   r   strr   r   r&   propertyr4   r7   r:   rN   __classcell__r,   s   @r-   r   r      s{    * "33 c3h3 	3
 3 c]3@   #/G# Gr.   r   c                   T     e Zd Zdedededef fdZdefdZdefdZdefd	Z	 xZ
S )
r1   r   r   r   r   c                 |    t         |   |       |||d| _         dj                  di | j                  | _        y)aO  
        Initialize the LogContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the Service to fetch the Log resource from.
        :param environment_sid: The SID of the environment with the Log resource to fetch.
        :param sid: The SID of the Log resource to fetch.
        r$   zA/Services/{service_sid}/Environments/{environment_sid}/Logs/{sid}N r%   r&   r)   rA   _uri)r+   r   r   r   r   r,   s        r-   r&   zLogContext.__init__x   sM     	! '.
 WOVV .. 		r.   r/   c                    t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d   | j                  d         S )	r6   application/jsonAcceptGETmethoduriheadersr   r   r   r$   )r   ofr2   r7   r[   r   r)   r+   rc   r   s      r-   r7   zLogContext.fetch   sv     ))B-.--%%U		7%SMM}5 NN+<=u%
 	
r.   c                 $  K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d   | j                  d   	      S 7 Ew)
r9   r]   r^   r_   r`   Nr   r   r   r$   )r   rd   r2   r:   r[   r   r)   re   s      r-   r:   zLogContext.fetch_async   s      ))B-.11dii 2 
 
 MM}5 NN+<=u%
 	
	
s   ABB	ABc                     dj                  d | j                  j                         D              }dj                  |      S )r<   r=   c              3   F   K   | ]  \  }}d j                  ||        ywr?   r@   rB   s      r-   rF   z&LogContext.__repr__.<locals>.<genexpr>   rG   rH   z$<Twilio.Serverless.V1.LogContext {}>rI   rL   s     r-   rN   zLogContext.__repr__   s6     ((SDNN<P<P<RSS5<<WEEr.   )rO   rP   rQ   r   rS   r&   r   r7   r:   rN   rU   rV   s   @r-   r1   r1   v   sN    

-0
CF
MP
2
{ 
,
; 
0F# Fr.   r1   c                   2    e Zd Zdeeef   defdZdefdZy)LogPager   r/   c                 h    t        | j                  || j                  d   | j                  d         S )zi
        Build an instance of LogInstance

        :param payload: Payload response from the API
        r   r   r   r   )r   r2   r)   )r+   r   s     r-   get_instancezLogPage.get_instance   s4     MM}5 NN+<=	
 	
r.   c                      y)r<   z<Twilio.Serverless.V1.LogPage>rY   r3   s    r-   rN   zLogPage.__repr__        0r.   N)	rO   rP   rQ   r   rS   r   r   rm   rN   rY   r.   r-   rj   rj      s)    
DcN 
{ 
0# 0r.   rj   c                       e Zd Zdededef fdZej                  ej                  ej                  ddfdeee	f   dee
e	f   dee
e	f   d	ee   d
ee   dee   fdZej                  ej                  ej                  ddfdeee	f   dee
e	f   dee
e	f   d	ee   d
ee   dee   fdZej                  ej                  ej                  ddfdeee	f   dee
e	f   dee
e	f   d	ee   d
ee   dee   fdZej                  ej                  ej                  ddfdeee	f   dee
e	f   dee
e	f   d	ee   d
ee   dee   fdZej                  ej                  ej                  ej                  ej                  ej                  fdeee	f   dee
e	f   dee
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                  ej                  fdeee	f   dee
e	f   dee
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defdZdedefdZdefdZ xZS )LogListr   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a  
        Initialize the LogList

        :param version: Version that contains the resource
        :param service_sid: The SID of the Service to read the Log resource from.
        :param environment_sid: The SID of the environment with the Log resources to read.

        rl   z;/Services/{service_sid}/Environments/{environment_sid}/LogsNrY   rZ   )r+   r   r   r   r,   s       r-   r&   zLogList.__init__   sJ     	! '.

 QIPP .. 		r.   Nr   
start_dateend_datelimit	page_sizer/   c                     | j                   j                  ||      }| j                  ||||d         }| j                   j                  ||d         S )a	  
        Streams LogInstance 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 str function_sid: The SID of the function whose invocation produced the Log resources to read.
        :param datetime start_date: The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.
        :param datetime end_date: The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.
        :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
        rv   r   rs   rt   rv   ru   )r2   read_limitspagestreamr+   r   rs   rt   ru   rv   limitsrz   s           r-   r{   zLogList.stream   s[    4 **5)<yy%![)	  
 }}##D&/::r.   c                    K   | j                   j                  ||      }| j                  ||||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams LogInstance 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 str function_sid: The SID of the function whose invocation produced the Log resources to read.
        :param datetime start_date: The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.
        :param datetime end_date: The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.
        :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
        rv   rx   Nru   )r2   ry   
page_asyncstream_asyncr|   s           r-   r   zLogList.stream_async  si     4 **5)<__%![)	 % 
 
 }}))$w@@
s   8A A$A c           	      @    t        | j                  |||||            S )a  
        Lists LogInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str function_sid: The SID of the function whose invocation produced the Log resources to read.
        :param datetime start_date: The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.
        :param datetime end_date: The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.
        :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   rs   rt   ru   rv   )listr{   )r+   r   rs   rt   ru   rv   s         r-   r   zLogList.listA  s1    2 KK)%!#  
 	
r.   c                    K   | j                  |||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists LogInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str function_sid: The SID of the function whose invocation produced the Log resources to read.
        :param datetime start_date: The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.
        :param datetime end_date: The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.
        :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   N)r   )r+   r   rs   rt   ru   rv   records          r-   
list_asynczLogList.list_asyncd  s]     6 '+&7&7)%!# '8 ' !	
 	
 !	
 	
 		
 	
s0   >1>953
59>59>
page_tokenpage_numberc           	      R   t        j                  |t        j                  |      t        j                  |      |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }	t        | j                  |	| j                        S )a  
        Retrieve a single page of LogInstance records from the API.
        Request is executed immediately

        :param function_sid: The SID of the function whose invocation produced the Log resources to read.
        :param start_date: The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.
        :param end_date: The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.
        :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 LogInstance
        FunctionSid	StartDateEndDate	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedr]   r^   r_   ra   rb   paramsrc   )	r   rd   r   r(   r2   rz   r[   rj   r)   
r+   r   rs   rt   r   r   rv   datarc   responses
             r-   rz   zLogList.page  s    , yy+&77
C$55h?'#%	
 ))^-PQR.==%%diig & 
 t}}h??r.   c           	      n  K   t        j                  |t        j                  |      t        j                  |      |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }	t        | j                  |	| j                        S 7 %w)	a  
        Asynchronously retrieve a single page of LogInstance records from the API.
        Request is executed immediately

        :param function_sid: The SID of the function whose invocation produced the Log resources to read.
        :param start_date: The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time.
        :param end_date: The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time.
        :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 LogInstance
        r   r   r   r]   r^   r_   r   N)	r   rd   r   r(   r2   r   r[   rj   r)   r   s
             r-   r   zLogList.page_async  s     , yy+&77
C$55h?'#%	
 ))^-PQR.11diig 2 
 
 t}}h??
s   BB5B3&B5
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of LogInstance records from the API.
        Request is executed immediately

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

        :returns: Page of LogInstance
        r_   )r2   domaintwiliorequestrj   r)   r+   r   r   s      r-   get_pagezLogList.get_page  s=     ==''..66ujIt}}h??r.   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)z
        Asynchronously retrieve a specific page of LogInstance records from the API.
        Request is executed immediately

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

        :returns: Page of LogInstance
        r_   N)r2   r   r   request_asyncrj   r)   r   s      r-   get_page_asynczLogList.get_page_async  sJ      --44BB5*UUt}}h?? Vs   4AA&Ar   c                 h    t        | j                  | j                  d   | j                  d   |      S zd
        Constructs a LogContext

        :param sid: The SID of the Log resource to fetch.
        r   r   r$   r1   r2   r)   r+   r   s     r-   r'   zLogList.get  4     MM}5 NN+<=	
 	
r.   c                 h    t        | j                  | j                  d   | j                  d   |      S r   r   r   s     r-   __call__zLogList.__call__  r   r.   c                      y)r<   z<Twilio.Serverless.V1.LogList>rY   r3   s    r-   rN   zLogList.__repr__  ro   r.   )rO   rP   rQ   r   rS   r&   r   unsetr   objectr   r   intr	   r   r{   r
   r   r   r   r   rj   rz   r   r   r   r1   r'   r   rN   rU   rV   s   @r-   rq   rq      s
   
 
c 
C 
0 ,2<<.4ll,2LL##'";CK("; (F*+"; &()	";
 }"; C="; 
+	";L ,2<<.4ll,2LL##'"ACK("A (F*+"A &()	"A
 }"A C="A 
{	#"AL ,2<<.4ll,2LL##'!
CK(!
 (F*+!
 &()	!

 }!
 C=!
 
k	!
J ,2<<.4ll,2LL##'"
CK("
 (F*+"
 &()	"

 }"
 C="
 
k	"
L ,2<<.4ll,2LL)/*0,,(.(@CK((@ (F*+(@ &()	(@
 #v+&(@ 3;'(@ f%(@ 
(@X ,2<<.4ll,2LL)/*0,,(.(@CK((@ (F*+(@ &()	(@
 #v+&(@ 3;'(@ f%(@ 
(@T
@3 
@7 
@
@s 
@w 
@
s 
z 

C 
J 
0# 0r.   rq   N)rR   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r1   rj   rq   rY   r.   r-   <module>r      sj     L L L 6 6 8 : 2 ' !ZG" ZGzPF PFf0d 00s0l s0r.   