
    piZ                         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 - Monitor
    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                   r     e Zd ZdZ	 ddedeeef   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 )AlertInstancea  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Alert resource.
    :ivar alert_text: The text of the alert.
    :ivar api_version: The API version used when the alert was generated.  Can be empty for events that don't have a specific API version.
    :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_generated: The date and time in GMT when the alert was generated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.  Due to buffering, this can be different than `date_created`.
    :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar error_code: The error code for the condition that generated the alert. See the [Error Dictionary](https://www.twilio.com/docs/api/errors) for possible causes and solutions to the error.
    :ivar log_level: The log level.  Can be: `error`, `warning`, `notice`, or `debug`.
    :ivar more_info: The URL of the page in our [Error Dictionary](https://www.twilio.com/docs/api/errors) with more information about the error condition.
    :ivar request_method: The method used by the request that generated the alert. If the alert was generated by a request we made to your server, this is the method we used. If the alert was generated by a request from your application to our API, this is the method your application used.
    :ivar request_url: The URL of the request that generated the alert. If the alert was generated by a request we made to your server, this is the URL on your server that generated the alert. If the alert was generated by a request from your application to our API, this is the URL of the resource requested.
    :ivar request_variables: The variables passed in the request that generated the alert. This value is only returned when a single Alert resource is fetched.
    :ivar resource_sid: The SID of the resource for which the alert was generated.  For instance, if your server failed to respond to an HTTP request during the flow of a particular call, this value would be the SID of the server.  This value is empty if the alert was not generated for a particular resource.
    :ivar response_body: The response body of the request that generated the alert. This value is only returned when a single Alert resource is fetched.
    :ivar response_headers: The response headers of the request that generated the alert. This value is only returned when a single Alert resource is fetched.
    :ivar sid: The unique string that we created to identify the Alert resource.
    :ivar url: The absolute URL of the Alert resource.
    :ivar request_headers: The request headers of the request that generated the alert. This value is only returned when a single Alert resource is fetched.
    :ivar service_sid: The SID of the service or resource that generated the alert. Can be `null`.
    versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _	        t        j                  |j                  d            | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        d|xs | j(                  i| _        d | _        y )Naccount_sid
alert_textapi_versiondate_createddate_generateddate_updated
error_code	log_level	more_inforequest_methodrequest_urlrequest_variablesresource_sidresponse_bodyresponse_headersr   urlrequest_headersservice_sid)super__init__getr   r   r   r   iso8601_datetimer   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r   r(   r)   r*   	_solution_context)selfr   r   r   	__class__s       ^/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/monitor/v1/alert.pyr,   zAlertInstance.__init__0   s    	!*1++m*D)0\)B*1++m*D0;0L0LKK'1
 3>2N2NKK()3
 1<0L0LKK'1
 *1\)B(/K(@(/K(@-4[[9I-J*1++m*D07<O0P+2;;~+F,3KK,H/6{{;M/N")++e"4")++e"4.5kk:K.L*1++m*D 3?$((
 15    returnc                     | j                   )t        | j                  | 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: AlertContext for this AlertInstance
        r   r   )r0   AlertContext_versionr/   r1   s    r3   _proxyzAlertInstance._proxyT   s9     == (NN5)DM }}r4   c                 6    | j                   j                         S )W
        Fetch the AlertInstance


        :returns: The fetched AlertInstance
        )r;   fetchr:   s    r3   r>   zAlertInstance.fetchc   s     {{  ""r4   c                 R   K   | j                   j                          d{   S 7 w)q
        Asynchronous coroutine to fetch the AlertInstance


        :returns: The fetched AlertInstance
        N)r;   fetch_asyncr:   s    r3   rA   zAlertInstance.fetch_asyncl   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      r3   	<genexpr>z)AlertInstance.__repr__.<locals>.<genexpr>{        SDAq7>>!Q/S   !z$<Twilio.Monitor.V1.AlertInstance {}>joinr/   itemsrH   r1   contexts     r3   __repr__zAlertInstance.__repr__u   s6     ((SDNN<P<P<RSS5<<WEEr4   )N)r5   r8   )r5   r   )__name__
__module____qualname____doc__r   r   strr   r   r,   propertyr;   r>   rA   rU   __classcell__r2   s   @r3   r   r      se    . OS"5"5)-c3h"5>Fsm"5H  #/F# Fr4   r   c                   L     e Zd Z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 )r8   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the AlertContext

        :param version: Version that contains the resource
        :param sid: The SID of the Alert resource to fetch.
        r   z/Alerts/{sid}N )r+   r,   r/   rH   _uri)r1   r   r   r2   s      r3   r,   zAlertContext.__init__   s?     	! 3
 +O**<T^^<	r4   r5   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )r=   application/jsonAcceptGETmethoduriheadersr   r7   )r   ofr9   r>   ra   r   r/   r1   ri   r   s      r3   r>   zAlertContext.fetch   s]     ))B-.--%%U		7%SMMu%
 	
r4   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)r@   rc   rd   re   rf   Nr   r7   )r   rj   r9   rA   ra   r   r/   rk   s      r3   rA   zAlertContext.fetch_async   sr      ))B-.11dii 2 
 
 MMu%
 	
	
s   AA4A2	*A4c                     dj                  d | j                  j                         D              }dj                  |      S )rC   rD   c              3   F   K   | ]  \  }}d j                  ||        ywrF   rG   rI   s      r3   rM   z(AlertContext.__repr__.<locals>.<genexpr>   rN   rO   z#<Twilio.Monitor.V1.AlertContext {}>rP   rS   s     r3   rU   zAlertContext.__repr__   s6     ((SDNN<P<P<RSS4;;GDDr4   )rV   rW   rX   r   rZ   r,   r   r>   rA   rU   r\   r]   s   @r3   r8   r8      s<    = =c =
} 
(
= 
,E# Er4   r8   c                   2    e Zd Zdeeef   defdZdefdZy)	AlertPager   r5   c                 .    t        | j                  |      S )zk
        Build an instance of AlertInstance

        :param payload: Payload response from the API
        )r   r9   )r1   r   s     r3   get_instancezAlertPage.get_instance   s     T]]G44r4   c                      y)rC   z<Twilio.Monitor.V1.AlertPage>r`   r:   s    r3   rU   zAlertPage.__repr__        /r4   N)	rV   rW   rX   r   rZ   r   r   rr   rU   r`   r4   r3   rp   rp      s)    5DcN 5} 5/# /r4   rp   c                       e Zd Z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 )	AlertListr   c                 2    t         |   |       d| _        y)zg
        Initialize the AlertList

        :param version: Version that contains the resource

        z/AlertsN)r+   r,   ra   )r1   r   r2   s     r3   r,   zAlertList.__init__   s     	!	r4   Nr    
start_dateend_datelimit	page_sizer5   c                     | j                   j                  ||      }| j                  ||||d         }| j                   j                  ||d         S )a  
        Streams AlertInstance 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 log_level: Only show alerts for this log-level.  Can be: `error`, `warning`, `notice`, or `debug`.
        :param datetime start_date: Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :param datetime end_date: Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :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    rx   ry   r{   rz   )r9   read_limitspagestreamr1   r    rx   ry   rz   r{   limitsr   s           r3   r   zAlertList.stream   s[    4 **5)<yy![)	  
 }}##D&/::r4   c                    K   | j                   j                  ||      }| j                  ||||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams AlertInstance 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 log_level: Only show alerts for this log-level.  Can be: `error`, `warning`, `notice`, or `debug`.
        :param datetime start_date: Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :param datetime end_date: Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :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}   Nrz   )r9   r~   
page_asyncstream_asyncr   s           r3   r   zAlertList.stream_async  si     4 **5)<__![)	 % 
 
 }}))$w@@
s   8A A$A c           	      @    t        | j                  |||||            S )aY  
        Lists AlertInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str log_level: Only show alerts for this log-level.  Can be: `error`, `warning`, `notice`, or `debug`.
        :param datetime start_date: Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :param datetime end_date: Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :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    rx   ry   rz   r{   )listr   )r1   r    rx   ry   rz   r{   s         r3   r   zAlertList.list,  s1    2 KK#%!#  
 	
r4   c                    K   | j                  |||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)ah  
        Asynchronously lists AlertInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str log_level: Only show alerts for this log-level.  Can be: `error`, `warning`, `notice`, or `debug`.
        :param datetime start_date: Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :param datetime end_date: Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :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   )r1   r    rx   ry   rz   r{   records          r3   
list_asynczAlertList.list_asyncO  s]     6 '+&7&7#%!# '8 ' !	
 	
 !	
 	
 		
 	
s0   >1>953
59>59>
page_tokenpage_numberc           	      <   t        j                  |t        j                  |      t        j                  |      |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }	t        | j                  |	      S )a  
        Retrieve a single page of AlertInstance records from the API.
        Request is executed immediately

        :param log_level: Only show alerts for this log-level.  Can be: `error`, `warning`, `notice`, or `debug`.
        :param start_date: Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :param end_date: Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :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 AlertInstance
        LogLevel	StartDateEndDate	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrc   rd   re   rg   rh   paramsri   )r   rj   r   r.   r9   r   ra   rp   
r1   r    rx   ry   r   r   r{   datari   responses
             r3   r   zAlertList.pages  s    , yy%&77
C$55h?'#%	
 ))^-PQR.==%%diig & 
 11r4   c           	      X  K   t        j                  |t        j                  |      t        j                  |      |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }	t        | j                  |	      S 7 w)	a  
        Asynchronously retrieve a single page of AlertInstance records from the API.
        Request is executed immediately

        :param log_level: Only show alerts for this log-level.  Can be: `error`, `warning`, `notice`, or `debug`.
        :param start_date: Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :param end_date: Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
        :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 AlertInstance
        r   r   r   rc   rd   re   r   N)r   rj   r   r.   r9   r   ra   rp   r   s
             r3   r   zAlertList.page_async  s     , yy%&77
C$55h?'#%	
 ))^-PQR.11diig 2 
 
 11
s   BB*B(B*
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )z
        Retrieve a specific page of AlertInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AlertInstance
        re   )r9   domaintwiliorequestrp   r1   r   r   s      r3   get_pagezAlertList.get_page  s7     ==''..66ujI11r4   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)z
        Asynchronously retrieve a specific page of AlertInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AlertInstance
        re   N)r9   r   r   request_asyncrp   r   s      r3   get_page_asynczAlertList.get_page_async  sD      --44BB5*UU11 Vs   4AAAr   c                 0    t        | j                  |      S zh
        Constructs a AlertContext

        :param sid: The SID of the Alert resource to fetch.
        r7   r8   r9   r1   r   s     r3   r-   zAlertList.get       DMMs33r4   c                 0    t        | j                  |      S r   r   r   s     r3   __call__zAlertList.__call__  r   r4   c                      y)rC   z<Twilio.Monitor.V1.AlertList>r`   r:   s    r3   rU   zAlertList.__repr__  rt   r4   )rV   rW   rX   r   r,   r   unsetr   rZ   objectr   r   intr	   r   r   r
   r   r   r   r   rp   r   r   r   r   r8   r-   r   rU   r\   r]   s   @r3   rv   rv      s   	 	 )/.4ll,2LL##'";f%"; (F*+"; &()	";
 }"; C="; 
-	 ";L )/.4ll,2LL##'"Af%"A (F*+"A &()	"A
 }"A C="A 
}	%"AL )/.4ll,2LL##'!
f%!
 (F*+!
 &()	!

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

 }"
 C="
 
m	"
L )/.4ll,2LL)/*0,,(.(2f%(2 (F*+(2 &()	(2
 #v+&(2 3;'(2 f%(2 
(2X )/.4ll,2LL)/*0,,(.(2f%(2 (F*+(2 &()	(2
 #v+&(2 3;'(2 f%(2 
(2T
23 
29 
2
2s 
2y 
24s 4| 44C 4L 4/# /r4   rv   N)rY   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   r8   rp   rv   r`   r4   r3   <module>r      sj     L L L 6 6 8 : 2 ' !cF$ cFLBE? BEJ/ /&^/ ^/r4   