o
    eh=                     @   s   d 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 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G dd deZdS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd Z fddZejejejddfddZejejejddfddZejejejejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )	AlertListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the AlertList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.monitor.v1.alert.AlertList
        :rtype: twilio.rest.monitor.v1.alert.AlertList
        z/AlertsN )superr	   __init__	_solutionformat_uri)selfversion	__class__r
   O/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/monitor/v1/alert.pyr      s   	zAlertList.__init__Nc                 C   s6   | j ||}| j||||d d}| 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 unicode log_level: Only show alerts for this log-level
        :param datetime start_date: Only include alerts that occurred on or after this date and time
        :param datetime end_date: Only include alerts that occurred on or before this date and time
        :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.monitor.v1.alert.AlertInstance]
        	page_size)	log_level
start_dateend_dater   limit)_versionread_limitspagestream)r   r   r   r   r   r   limitsr   r
   r
   r   r   #   s   zAlertList.streamc                 C   s   t | j|||||dS )ac  
        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 unicode log_level: Only show alerts for this log-level
        :param datetime start_date: Only include alerts that occurred on or after this date and time
        :param datetime end_date: Only include alerts that occurred on or before this date and time
        :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.monitor.v1.alert.AlertInstance]
        )r   r   r   r   r   )listr   )r   r   r   r   r   r   r
   r
   r   r   C   s   zAlertList.listc           	   	   C   sH   t |t|t||||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of AlertInstance records from the API.
        Request is executed immediately

        :param unicode log_level: Only show alerts for this log-level
        :param datetime start_date: Only include alerts that occurred on or after this date and time
        :param datetime end_date: Only include alerts that occurred on or before this date and time
        :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 AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertPage
        )LogLevel	StartDateEndDate	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   iso8601_datetimer   r   r   	AlertPager   )	r   r   r   r   
page_tokenpage_numberr   dataresponser
   r
   r   r   _   s   	zAlertList.pagec                 C   s"   | j jjd|}t| j || jS )a*  
        Retrieve a specific page of AlertInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertPage
        r%   )r   domaintwiliorequestr+   r   )r   
target_urlr/   r
   r
   r   get_page}   s
   

zAlertList.get_pagec                 C      t | j|dS z
        Constructs a AlertContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.monitor.v1.alert.AlertContext
        :rtype: twilio.rest.monitor.v1.alert.AlertContext
        sidAlertContextr   r   r8   r
   r
   r   get      	zAlertList.getc                 C   r5   r6   r9   r;   r
   r
   r   __call__   r=   zAlertList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Monitor.V1.AlertList>r
   r   r
   r
   r   __repr__      zAlertList.__repr__)__name__
__module____qualname__r   r   unsetr   r   r   r4   r<   r>   rB   __classcell__r
   r
   r   r   r	      s     
 

r	   c                       ,   e Zd Z fddZdd Zdd Z  ZS )r+   c                    s   t t| || || _dS )a  
        Initialize the AlertPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.monitor.v1.alert.AlertPage
        :rtype: twilio.rest.monitor.v1.alert.AlertPage
        N)r   r+   r   r   )r   r   r/   solutionr   r
   r   r      s   

zAlertPage.__init__c                 C   s   t | j|S )z
        Build an instance of AlertInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.monitor.v1.alert.AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertInstance
        )AlertInstancer   r   payloadr
   r
   r   get_instance   s   	zAlertPage.get_instancec                 C   r?   )r@   z<Twilio.Monitor.V1.AlertPage>r
   rA   r
   r
   r   rB      rC   zAlertPage.__repr__)rD   rE   rF   r   rN   rB   rH   r
   r
   r   r   r+      s    r+   c                       rI   )r:   c                    s2   t t| | d|i| _djdi | j| _dS )a*  
        Initialize the AlertContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.monitor.v1.alert.AlertContext
        :rtype: twilio.rest.monitor.v1.alert.AlertContext
        r8   z/Alerts/{sid}Nr
   )r   r:   r   r   r   r   )r   r   r8   r   r
   r   r      s   

zAlertContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the AlertInstance

        :returns: The fetched AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertInstance
        r%   )r&   r'   r8   r7   )r   fetchr   rK   r   rL   r
   r
   r   rP      s   zAlertContext.fetchc                 C   $   d dd | j D }d|S )r@    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>       z(AlertContext.__repr__.<locals>.<genexpr>z#<Twilio.Monitor.V1.AlertContext {}>joinr   itemsr   r   contextr
   r
   r   rB         
zAlertContext.__repr__)rD   rE   rF   r   rP   rB   rH   r
   r
   r   r   r:      s    r:   c                       s  e Zd Zd0 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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ed(d) Zed*d+ Zd,d- Zd.d/ Z  ZS )1rK   Nc                    s(  t t| | i d|dd|dd|ddt|ddt|ddt|dd|dd|dd	|d	d
|d
d|dd|dd|dd|dd|dd|dd|d|d|dd| _d| _d|p| jd i| _dS )z
        Initialize the AlertInstance

        :returns: twilio.rest.monitor.v1.alert.AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertInstance
        account_sid
alert_textapi_versiondate_createddate_generateddate_updated
error_coder   	more_inforequest_methodrequest_urlrequest_variablesresource_sidresponse_bodyresponse_headersr8   urlrequest_headersservice_sid)rq   rr   N)	r   rK   r   r<   r   r*   _properties_contextr   )r   r   rM   r8   r   r
   r   r      sR   





	









zAlertInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a   
        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
        :rtype: twilio.rest.monitor.v1.alert.AlertContext
        Nr8   r7   )rt   r:   r   r   rA   r
   r
   r   _proxy"  s   
	zAlertInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rb   rs   rA   r
   r
   r   rb   /     
zAlertInstance.account_sidc                 C   rv   )zI
        :returns: The text of the alert
        :rtype: unicode
        rc   rw   rA   r
   r
   r   rc   7  rx   zAlertInstance.alert_textc                 C   rv   )ze
        :returns: The API version used when the alert was generated
        :rtype: unicode
        rd   rw   rA   r
   r
   r   rd   ?  rx   zAlertInstance.api_versionc                 C   rv   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        re   rw   rA   r
   r
   r   re   G  rx   zAlertInstance.date_createdc                 C   rv   )z
        :returns: The date and time when the alert was generated specified in ISO 8601 format
        :rtype: datetime
        rf   rw   rA   r
   r
   r   rf   O  rx   zAlertInstance.date_generatedc                 C   rv   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rg   rw   rA   r
   r
   r   rg   W  rx   zAlertInstance.date_updatedc                 C   rv   )zm
        :returns: The error code for the condition that generated the alert
        :rtype: unicode
        rh   rw   rA   r
   r
   r   rh   _  rx   zAlertInstance.error_codec                 C   rv   )zA
        :returns: The log level
        :rtype: unicode
        r   rw   rA   r
   r
   r   r   g  rx   zAlertInstance.log_levelc                 C   rv   )z
        :returns: The URL of the page in our Error Dictionary with more information about the error condition
        :rtype: unicode
        ri   rw   rA   r
   r
   r   ri   o  rx   zAlertInstance.more_infoc                 C   rv   )zk
        :returns: The method used by the request that generated the alert
        :rtype: unicode
        rj   rw   rA   r
   r
   r   rj   w  rx   zAlertInstance.request_methodc                 C   rv   )zc
        :returns: The URL of the request that generated the alert
        :rtype: unicode
        rk   rw   rA   r
   r
   r   rk     rx   zAlertInstance.request_urlc                 C   rv   )zp
        :returns: The variables passed in the request that generated the alert
        :rtype: unicode
        rl   rw   rA   r
   r
   r   rl     rx   zAlertInstance.request_variablesc                 C   rv   )zm
        :returns: The SID of the resource for which the alert was generated
        :rtype: unicode
        rm   rw   rA   r
   r
   r   rm     rx   zAlertInstance.resource_sidc                 C   rv   )zm
        :returns: The response body of the request that generated the alert
        :rtype: unicode
        rn   rw   rA   r
   r
   r   rn     rx   zAlertInstance.response_bodyc                 C   rv   )zp
        :returns: The response headers of the request that generated the alert
        :rtype: unicode
        ro   rw   rA   r
   r
   r   ro     rx   zAlertInstance.response_headersc                 C   rv   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r8   rw   rA   r
   r
   r   r8     rx   zAlertInstance.sidc                 C   rv   )zZ
        :returns: The absolute URL of the Alert resource
        :rtype: unicode
        rp   rw   rA   r
   r
   r   rp     rx   zAlertInstance.urlc                 C   rv   )zo
        :returns: The request headers of the request that generated the alert
        :rtype: unicode
        rq   rw   rA   r
   r
   r   rq     rx   zAlertInstance.request_headersc                 C   rv   )zo
        :returns: The SID of the service or resource that generated the alert
        :rtype: unicode
        rr   rw   rA   r
   r
   r   rr     rx   zAlertInstance.service_sidc                 C   s
   | j  S )rO   )ru   rP   rA   r
   r
   r   rP     s   
zAlertInstance.fetchc                 C   rQ   )r@   rR   c                 s   rS   rT   rU   rV   r
   r
   r   rZ     r[   z)AlertInstance.__repr__.<locals>.<genexpr>z$<Twilio.Monitor.V1.AlertInstance {}>r\   r_   r
   r
   r   rB     ra   zAlertInstance.__repr__)N)rD   rE   rF   r   propertyru   rb   rc   rd   re   rf   rg   rh   r   ri   rj   rk   rl   rm   rn   ro   r8   rp   rq   rr   rP   rB   rH   r
   r
   r   r   rK      sX    $



















	rK   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r+   r:   rK   r
   r
   r
   r   <module>   s    &(