o
    eD                     @   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ejddfddZejejejejddfddZej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 )NotificationListc                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the NotificationList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource
        :param call_sid: The SID of the Call the resource is associated with

        :returns: twilio.rest.api.v2010.account.call.notification.NotificationList
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationList
        account_sidcall_sidz;/Accounts/{account_sid}/Calls/{call_sid}/Notifications.jsonN )superr	   __init__	_solutionformat_uri)selfversionr   r   	__class__r   b/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/api/v2010/account/call/notification.pyr      s   zNotificationList.__init__Nc           	      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 unicode log: Filter by log level
        :param date message_date_before: Filter by date
        :param date message_date: Filter by date
        :param date message_date_after: Filter by 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.api.v2010.account.call.notification.NotificationInstance]
        	page_size)logmessage_date_beforemessage_datemessage_date_afterr   limit)_versionread_limitspagestream)	r   r   r   r   r   r   r   limitsr    r   r   r   r!   %   s   zNotificationList.streamc              	   C   s   t | j||||||dS )aE  
        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 unicode log: Filter by log level
        :param date message_date_before: Filter by date
        :param date message_date: Filter by date
        :param date message_date_after: Filter by 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.api.v2010.account.call.notification.NotificationInstance]
        )r   r   r   r   r   r   )listr!   )r   r   r   r   r   r   r   r   r   r   r#   H   s   zNotificationList.listc           
   
   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 unicode log: Filter by log level
        :param date message_date_before: Filter by date
        :param date message_date: Filter by date
        :param date message_date_after: Filter by 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 NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationPage
        )LogzMessageDate<MessageDatezMessageDate>	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   iso8601_dater   r    r   NotificationPager   )
r   r   r   r   r   
page_tokenpage_numberr   dataresponser   r   r   r    g   s   
zNotificationList.pagec                 C   s"   | j jjd|}t| j || jS )aR  
        Retrieve a specific page of NotificationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationPage
        r(   )r   domaintwiliorequestr.   r   )r   
target_urlr2   r   r   r   get_page   s
   

zNotificationList.get_pagec                 C      t | j| jd | jd |dS a!  
        Constructs a NotificationContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.call.notification.NotificationContext
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationContext
        r   r   r   r   sidNotificationContextr   r   r   r;   r   r   r   get      	zNotificationList.getc                 C   r8   r9   r<   r>   r   r   r   __call__   r@   zNotificationList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Api.V2010.NotificationList>r   r   r   r   r   __repr__      zNotificationList.__repr__)__name__
__module____qualname__r   r   unsetr!   r#   r    r7   r?   rA   rE   __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 NotificationPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The SID of the Account that created the resource
        :param call_sid: The SID of the Call the resource is associated with

        :returns: twilio.rest.api.v2010.account.call.notification.NotificationPage
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationPage
        N)r   r.   r   r   )r   r   r2   solutionr   r   r   r      s   
zNotificationPage.__init__c                 C   s   t | j|| jd | jd dS )a$  
        Build an instance of NotificationInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        r   r   r
   )NotificationInstancer   r   r   payloadr   r   r   get_instance   s   	zNotificationPage.get_instancec                 C   rB   )rC   z#<Twilio.Api.V2010.NotificationPage>r   rD   r   r   r   rE      rF   zNotificationPage.__repr__)rG   rH   rI   r   rQ   rE   rK   r   r   r   r   r.      s    r.   c                       rL   )r=   c                    s6   t t| | |||d| _djdi | j| _dS )a  
        Initialize the NotificationContext

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource to fetch
        :param call_sid: The Call SID of the resource to fetch
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.call.notification.NotificationContext
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationContext
        r:   zA/Accounts/{account_sid}/Calls/{call_sid}/Notifications/{sid}.jsonNr   )r   r=   r   r   r   r   )r   r   r   r   r;   r   r   r   r      s   zNotificationContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the NotificationInstance

        :returns: The fetched NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        r(   )r)   r*   r   r   r;   r:   )r   fetchr   rN   r   rO   r   r   r   rS     s   zNotificationContext.fetchc                 C   $   d dd | j D }d|S )rC    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>      z/NotificationContext.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.NotificationContext {}>joinr   itemsr   r   contextr   r   r   rE        
zNotificationContext.__repr__)rG   rH   rI   r   rS   rE   rK   r   r   r   r   r=      s    r=   c                       s  e 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  ZS )-rN   Nc                    s  t t| | i d|dd|dd|ddt|ddt|dd|dd|ddt|dd	|d	d
|d
d|dd|dd|dd|dd|dd|dd|d| _d| _|||p| jd d| _dS )z
        Initialize the NotificationInstance

        :returns: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        r   api_versionr   date_createddate_updated
error_coder   r   message_text	more_inforequest_methodrequest_urlrequest_variablesresponse_bodyresponse_headersr;   r*   Nr:   )	r   rN   r   r?   r   rfc2822_datetime_properties_contextr   )r   r   rP   r   r   r;   r   r   r   r   "  sR   





	








zNotificationInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )aH  
        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
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationContext
        Nr   r   r;   r:   )rr   r=   r   r   rD   r   r   r   _proxyH  s   
	zNotificationInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r   rq   rD   r   r   r   r   Z     
z NotificationInstance.account_sidc                 C   rt   )zq
        :returns: The API version used to create the Call Notification resource
        :rtype: unicode
        re   ru   rD   r   r   r   re   b  rv   z NotificationInstance.api_versionc                 C   rt   )zg
        :returns: The SID of the Call the resource is associated with
        :rtype: unicode
        r   ru   rD   r   r   r   r   j  rv   zNotificationInstance.call_sidc                 C   rt   )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        rf   ru   rD   r   r   r   rf   r  rv   z!NotificationInstance.date_createdc                 C   rt   )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rg   ru   rD   r   r   r   rg   z  rv   z!NotificationInstance.date_updatedc                 C   rt   )zi
        :returns: A unique error code corresponding to the notification
        :rtype: unicode
        rh   ru   rD   r   r   r   rh     rv   zNotificationInstance.error_codec                 C   rt   )zH
        :returns: An integer log level
        :rtype: unicode
        r   ru   rD   r   r   r   r     rv   zNotificationInstance.logc                 C   rt   )z\
        :returns: The date the notification was generated
        :rtype: datetime
        r   ru   rD   r   r   r   r     rv   z!NotificationInstance.message_datec                 C   rt   )zP
        :returns: The text of the notification
        :rtype: unicode
        ri   ru   rD   r   r   r   ri     rv   z!NotificationInstance.message_textc                 C   rt   )zc
        :returns: A URL for more information about the error code
        :rtype: unicode
        rj   ru   rD   r   r   r   rj     rv   zNotificationInstance.more_infoc                 C   rt   )zY
        :returns: HTTP method used with the request url
        :rtype: unicode
        rk   ru   rD   r   r   r   rk     rv   z#NotificationInstance.request_methodc                 C   rt   )zg
        :returns: URL of the resource that generated the notification
        :rtype: unicode
        rl   ru   rD   r   r   r   rl     rv   z NotificationInstance.request_urlc                 C   rt   )zf
        :returns: Twilio-generated HTTP variables sent to the server
        :rtype: unicode
        rm   ru   rD   r   r   r   rm     rv   z&NotificationInstance.request_variablesc                 C   rt   )zY
        :returns: The HTTP body returned by your server
        :rtype: unicode
        rn   ru   rD   r   r   r   rn     rv   z"NotificationInstance.response_bodyc                 C   rt   )z\
        :returns: The HTTP headers returned by your server
        :rtype: unicode
        ro   ru   rD   r   r   r   ro     rv   z%NotificationInstance.response_headersc                 C   rt   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r;   ru   rD   r   r   r   r;     rv   zNotificationInstance.sidc                 C   rt   )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r*   ru   rD   r   r   r   r*     rv   zNotificationInstance.uric                 C   s
   | j  S )rR   )rs   rS   rD   r   r   r   rS     s   
zNotificationInstance.fetchc                 C   rT   )rC   rU   c                 s   rV   rW   rX   rY   r   r   r   r]     r^   z0NotificationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.NotificationInstance {}>r_   rb   r   r   r   rE     rd   zNotificationInstance.__repr__)N)rG   rH   rI   r   propertyrs   r   re   r   rf   rg   rh   r   r   ri   rj   rk   rl   rm   rn   ro   r;   r*   rS   rE   rK   r   r   r   r   rN      sP    &

















	rN   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r.   r=   rN   r   r   r   r   <module>   s    2-0