o
    �¨Êh‚<  ã                   @   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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 )Ú	AlertListú  c                    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   úN/var/www/html/env/lib/python3.10/site-packages/twilio/rest/monitor/v1/alert.pyr      s   	zAlertList.__init__Nc                 C   s<   | j  ||¡}| j||||d d�}| j  ||d |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 date start_date: Only show Alerts on or after this date.
        :param date end_date: Only show Alerts on or before this date.
        :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Ú
page_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 )a*  
        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 date start_date: Only show Alerts on or after this date.
        :param date end_date: Only show Alerts on or before this date.
        :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!   D   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 date start_date: Only show Alerts on or after this date.
        :param date end_date: Only show Alerts on or before this date.
        :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©Úparams)	r   Úofr   Úiso8601_dater   r   r   Ú	AlertPager   )	r   r   r   r   Ú
page_tokenÚpage_numberr   r)   Ú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

        :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__Ú__doc__r   r   Úunsetr   r!   r   r4   r<   r>   rB   Ú__classcell__r   r   r   r   r	      s"    
ÿ 
ÿ
þ"r	   c                       s0   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )r,   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   rG   r   rM   rB   rI   r   r   r   r   r,   ³   s
    r,   c                       s8   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Z‡  ZS )
r:   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

        :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   s4   t  i ¡}| jjd| j|d�}t| j|| jd d�S )ú‹
        Fetch a AlertInstance

        :returns: Fetched AlertInstance
        :rtype: twilio.rest.monitor.v1.alert.AlertInstance
        r'   r(   r8   r7   )r   r*   r   Úfetchr   rK   r   )r   r)   rL   r   r   r   rO   í   s   
ýzAlertContext.fetchc                 C   s   | j  d| j¡S )ú|
        Deletes the AlertInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rQ   r   rA   r   r   r   rQ   þ   s   zAlertContext.deletec                 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   rG   r   rO   rQ   rB   rI   r   r   r   r   r:   Ú   s    	r:   c                       s  e Zd ZdZd/‡ 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d)d*„ Zd+d,„ Zd-d.„ Z‡  ZS )0rK   r
   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|pv| 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Úresource_sidr8   ÚurlÚrequest_variablesÚresponse_bodyÚresponse_headersN)	r   rK   r   r   Úiso8601_datetimer<   Ú_propertiesÚ_contextr   )r   r   rL   r8   r   r   r   r     sL   ÿþýüûúùø	÷
öõôóò
ñ
ð
ï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   Ú_proxy7  s   
	zAlertInstance._proxyc                 C   ó
   | j d S )zl
        :returns: The unique id of the Account responsible for this alert.
        :rtype: unicode
        rc   ©rs   rA   r   r   r   rc   D  ó   
zAlertInstance.account_sidc                 C   rv   )zJ
        :returns: The text of the alert.
        :rtype: unicode
        rd   rw   rA   r   r   r   rd   L  rx   zAlertInstance.alert_textc                 C   rv   )zw
        :returns: The version of the Twilio API in use when this alert was generated.
        :rtype: unicode
        re   rw   rA   r   r   r   re   T  rx   zAlertInstance.api_versionc                 C   rv   )zw
        :returns: The date that this resource was created, given in ISO 8601 format.
        :rtype: datetime
        rf   rw   rA   r   r   r   rf   \  rx   zAlertInstance.date_createdc                 C   rv   )zy
        :returns: The date the alert was actually generated, given in ISO 8601 format.
        :rtype: datetime
        rg   rw   rA   r   r   r   rg   d  rx   zAlertInstance.date_generatedc                 C   rv   )zƒ
        :returns: The most recent date that this resource was updated, given in ISO 8601 format.
        :rtype: datetime
        rh   rw   rA   r   r   r   rh   l  rx   zAlertInstance.date_updatedc                 C   rv   )z`
        :returns: A unique error code for the error condition.
        :rtype: unicode
        ri   rw   rA   r   r   r   ri   t  rx   zAlertInstance.error_codec                 C   rv   )zX
        :returns: A string representing the log level.
        :rtype: unicode
        r   rw   rA   r   r   r   r   |  rx   zAlertInstance.log_levelc                 C   rv   )zi
        :returns: A URL for more information about the error condition.
        :rtype: unicode
        rj   rw   rA   r   r   r   rj   „  rx   zAlertInstance.more_infoc                 C   rv   )zÉ
        :returns: If the Alert was generated by a request Twilio made to your server, this will be the request method used when Twilio made the request to your server.
        :rtype: unicode
        rk   rw   rA   r   r   r   rk   Œ  rx   zAlertInstance.request_methodc                 C   rv   )zµ
        :returns: If the Alert was generated by a request Twilio made to your server, this will be the URL on your server that generated the alert.
        :rtype: unicode
        rl   rw   rA   r   r   r   rl   ”  rx   zAlertInstance.request_urlc                 C   rv   )zI
        :returns: The request_variables
        :rtype: unicode
        ro   rw   rA   r   r   r   ro   œ  rx   zAlertInstance.request_variablesc                 C   rv   )zt
        :returns: The unique ID 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   )zE
        :returns: The response_body
        :rtype: unicode
        rp   rw   rA   r   r   r   rp   ¬  rx   zAlertInstance.response_bodyc                 C   rv   )zH
        :returns: The response_headers
        :rtype: unicode
        rq   rw   rA   r   r   r   rq   ´  rx   zAlertInstance.response_headersc                 C   rv   )zn
        :returns: A 34 character string that uniquely identifies this Alert.
        :rtype: unicode
        r8   rw   rA   r   r   r   r8   ¼  rx   zAlertInstance.sidc                 C   rv   )zW
        :returns: The absolute URL for this resource.
        :rtype: unicode
        rn   rw   rA   r   r   r   rn   Ä  rx   zAlertInstance.urlc                 C   ó
   | j  ¡ S )rN   )ru   rO   rA   r   r   r   rO   Ì  ó   
zAlertInstance.fetchc                 C   ry   )rP   )ru   rQ   rA   r   r   r   rQ   Õ  rz   zAlertInstance.deletec                 C   rR   )r@   rS   c                 s   rT   rU   rV   rW   r   r   r   r[   å  r\   z)AlertInstance.__repr__.<locals>.<genexpr>z$<Twilio.Monitor.V1.AlertInstance {}>r]   r`   r   r   r   rB   Þ  rb   zAlertInstance.__repr__)N)rD   rE   rF   rG   r   Úpropertyru   rc   rd   re   rf   rg   rh   ri   r   rj   rk   rl   ro   rm   rp   rq   r8   rn   rO   rQ   rB   rI   r   r   r   r   rK     sT    "

















		rK   N)rG   Ú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    "'8