a
    !fqk                     @   s   d Z ddlmZ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 deZG dd deZG dd deZG dd deZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Api
    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.
    )datedatetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       sv   e Zd ZdZdeeeef eee d fddZ	e
dddd	Zd dd
dZd dddZedddZ  ZS )NotificationInstancea'
  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource.
    :ivar api_version: The API version used to generate the notification. Can be empty for events that don't have a specific API version, such as incoming phone calls.
    :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Notification resource is associated with.
    :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar error_code: A unique error code for the error condition that is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors).
    :ivar log: An integer log level that corresponds to the type of notification: `0` is ERROR, `1` is WARNING.
    :ivar message_date: The date the notification was actually generated in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from `date_created`.
    :ivar message_text: The text of the notification.
    :ivar more_info: The URL for more information about the error condition. This value is a page in our [Error Dictionary](https://www.twilio.com/docs/api/errors).
    :ivar request_method: The HTTP method used to generate the notification. If the notification was generated during a phone call, this is the HTTP Method used to request the resource on your server. If the notification was generated by your use of our REST API, this is the HTTP method used to call the resource on our servers.
    :ivar request_url: The URL of the resource that generated the notification. If the notification was generated during a phone call, this is the URL of the resource on your server that caused the notification. If the notification was generated by your use of our REST API, this is the URL of the resource you called.
    :ivar request_variables: The HTTP GET or POST variables we sent to your server. However, if the notification was generated by our REST API, this contains the HTTP POST or PUT variables you sent to our API.
    :ivar response_body: The HTTP body returned by your server.
    :ivar response_headers: The HTTP headers returned by your server.
    :ivar sid: The unique string that that we created to identify the Notification resource.
    :ivar uri: The URI of the resource, relative to `https://api.twilio.com`.
    N)versionpayloadaccount_sidsidc                    s  t  | |d| _|d| _|d| _t|d| _t|d| _	|d| _
|d| _t|d| _|d	| _|d
| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _||p| jd| _d | _d S )Nr   api_versioncall_siddate_createddate_updated
error_codelogmessage_datemessage_text	more_inforequest_methodrequest_urlrequest_variablesresponse_bodyresponse_headersr   urir   r   )super__init__getr   r   r   r   Zrfc2822_datetimer   r   r   r   r   r   r    r!   r"   r#   r$   r%   r   r&   	_solution_context)selfr   r   r   r   	__class__ k/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/api/v2010/account/notification.pyr)   0   s8    zNotificationInstance.__init__NotificationContextreturnc                 C   s.   | j du r(t| j| jd | jd 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: NotificationContext for this NotificationInstance
        Nr   r   r'   )r,   r2   _versionr+   r-   r0   r0   r1   _proxyW   s    
zNotificationInstance._proxyc                 C   s
   | j  S )e
        Fetch the NotificationInstance


        :returns: The fetched NotificationInstance
        )r7   fetchr6   r0   r0   r1   r9   g   s    zNotificationInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the NotificationInstance


        :returns: The fetched NotificationInstance
        N)r7   fetch_asyncr6   r0   r0   r1   r;   p   s    z NotificationInstance.fetch_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr0   r0   r1   	<genexpr>       z0NotificationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.NotificationInstance {}>joinr+   itemsr@   r-   contextr0   r0   r1   __repr__y   s    zNotificationInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r)   propertyr7   r9   r;   rL   __classcell__r0   r0   r.   r1   r      s    
'		r   c                       sP   e Zd Zeeed fddZedddZedddZedd	d
Z	  Z
S )r2   )r   r   r   c                    s0   t  | ||d| _djf i | j| _dS )ao  
        Initialize the NotificationContext

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource to fetch.
        :param sid: The Twilio-provided string that uniquely identifies the Notification resource to fetch.
        r'   z0/Accounts/{account_sid}/Notifications/{sid}.jsonNr(   r)   r+   r@   _uri)r-   r   r   r   r.   r0   r1   r)      s    zNotificationContext.__init__r3   c                 C   s0   | j jd| jd}t| j || jd | jd dS )r8   GETmethodr&   r   r   r'   )r5   r9   rU   r   r+   r-   r   r0   r0   r1   r9      s    zNotificationContext.fetchc                    s6   | j jd| jdI dH }t| j || jd | jd dS )r:   rV   rW   Nr   r   r'   )r5   r;   rU   r   r+   rY   r0   r0   r1   r;      s    zNotificationContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r<   r=   c                 s   s   | ]\}}d  ||V  qdS r>   r?   rA   r0   r0   r1   rE      rF   z/NotificationContext.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.NotificationContext {}>rG   rJ   r0   r0   r1   rL      s    zNotificationContext.__repr__)rM   rN   rO   r   rQ   r)   r   r9   r;   rL   rS   r0   r0   r.   r1   r2      s   r2   c                   @   s2   e Zd Zeeef edddZedddZdS )NotificationPage)r   r4   c                 C   s   t | j|| jd dS )zr
        Build an instance of NotificationInstance

        :param payload: Payload response from the API
        r   )r   )r   r5   r+   rY   r0   r0   r1   get_instance   s    zNotificationPage.get_instancer3   c                 C   s   dS )r<   z#<Twilio.Api.V2010.NotificationPage>r0   r6   r0   r0   r1   rL      s    zNotificationPage.__repr__N)	rM   rN   rO   r   rQ   r   r   r[   rL   r0   r0   r0   r1   rZ      s   
rZ   c                
       s  e Zd Zeed fddZejejejejddfee	e
f eee
f eee
f eee
f ee	 ee	 ee dddZejejejejddfee	e
f eee
f eee
f eee
f ee	 ee	 ee ddd	Zejejejejddfee	e
f eee
f eee
f eee
f ee	 ee	 ee dd
dZejejejejddfee	e
f eee
f eee
f eee
f ee	 ee	 ee dddZejejejejejejejfee	e
f eee
f eee
f eee
f eee
f ee	e
f ee	e
f edddZejejejejejejejfee	e
f eee
f eee
f eee
f eee
f ee	e
f ee	e
f edddZeedddZeedddZeedddZeedddZedddZ  ZS ) NotificationList)r   r   c                    s.   t  | d|i| _djf i | j| _dS )a  
        Initialize the NotificationList

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resources to read.

        r   z*/Accounts/{account_sid}/Notifications.jsonNrT   )r-   r   r   r.   r0   r1   r)      s    zNotificationList.__init__N)r   r   message_date_beforemessage_date_afterlimit	page_sizer4   c           	      C   s8   | j ||}| j|||||d d}| j ||d S )a  
        Streams NotificationInstance 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 int log: Only read notifications of the specified log level. Can be:  `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
        :param date message_date: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_before: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_after: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :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   r   r]   r^   r`   r_   )r5   read_limitspagestream	r-   r   r   r]   r^   r_   r`   Zlimitsrc   r0   r0   r1   rd      s    zNotificationList.streamc           	         s>   | j ||}| j|||||d dI dH }| j ||d S )a  
        Asynchronously streams NotificationInstance 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 int log: Only read notifications of the specified log level. Can be:  `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
        :param date message_date: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_before: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_after: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :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`   ra   Nr_   )r5   rb   
page_asyncstream_asyncre   r0   r0   r1   rg     s    zNotificationList.stream_asyncc              	   C   s   t | j||||||dS )aB  
        Lists NotificationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param int log: Only read notifications of the specified log level. Can be:  `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
        :param date message_date: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_before: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_after: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :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   r   r]   r^   r_   r`   )listrd   r-   r   r   r]   r^   r_   r`   r0   r0   r1   ri   >  s    zNotificationList.listc              	      s,   dd | j ||||||dI dH 2 I dH S )aQ  
        Asynchronously lists NotificationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param int log: Only read notifications of the specified log level. Can be:  `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
        :param date message_date: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_before: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param date message_date_after: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :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
        c                    s   g | z3 d H W }|q6 S )Nr0   )rB   recordr0   r0   r1   
<listcomp>  s   z/NotificationList.list_async.<locals>.<listcomp>rh   N)rg   rj   r0   r0   r1   
list_asyncd  s    
zNotificationList.list_async)r   r   r]   r^   
page_tokenpage_numberr`   r4   c           
   
   C   sP   t |t|t|t||||d}| jjd| j|d}	t| j|	| jS )a  
        Retrieve a single page of NotificationInstance records from the API.
        Request is executed immediately

        :param log: Only read notifications of the specified log level. Can be:  `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
        :param message_date: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param message_date_before: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param message_date_after: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :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 NotificationInstance
        LogZMessageDatezMessageDate<zMessageDate>Z	PageTokenr   ZPageSizerV   rX   r&   params)	r   ofr   iso8601_dater5   rc   rU   rZ   r+   
r-   r   r   r]   r^   rn   ro   r`   dataresponser0   r0   r1   rc     s    zNotificationList.pagec           
   
      sV   t |t|t|t||||d}| jjd| j|dI dH }	t| j|	| jS )a  
        Asynchronously retrieve a single page of NotificationInstance records from the API.
        Request is executed immediately

        :param log: Only read notifications of the specified log level. Can be:  `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
        :param message_date: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param message_date_before: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :param message_date_after: Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
        :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 NotificationInstance
        rp   rV   rr   N)	r   rt   r   ru   r5   rf   rU   rZ   r+   rv   r0   r0   r1   rf     s    zNotificationList.page_async)
target_urlr4   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of NotificationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of NotificationInstance
        rV   )r5   domaintwiliorequestrZ   r+   r-   ry   rx   r0   r0   r1   get_page  s    	zNotificationList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of NotificationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of NotificationInstance
        rV   N)r5   rz   r{   Zrequest_asyncrZ   r+   r}   r0   r0   r1   get_page_async  s    	zNotificationList.get_page_async)r   r4   c                 C   s   t | j| jd |dS z
        Constructs a NotificationContext

        :param sid: The Twilio-provided string that uniquely identifies the Notification resource to fetch.
        r   r'   r2   r5   r+   r-   r   r0   r0   r1   r*     s    zNotificationList.getc                 C   s   t | j| jd |dS r   r   r   r0   r0   r1   __call__  s    zNotificationList.__call__r3   c                 C   s   dS )r<   z#<Twilio.Api.V2010.NotificationList>r0   r6   r0   r0   r1   rL     s    zNotificationList.__repr__)rM   rN   rO   r   rQ   r)   r   unsetr   intobjectr   r   r	   r   rd   r
   rg   r   ri   rm   rZ   rc   rf   r~   r   r2   r*   r   rL   rS   r0   r0   r.   r1   r\      s   



)



)



(



)






)






)

r\   N)rP   r   r   typingr   r   r   r   r   r	   r
   Ztwilio.baser   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r2   rZ   r\   r0   r0   r0   r1   <module>   s   $iF