B
    `D                 @   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                s0   t t| | ||d| _djf | 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__ ^/home/dcms/DCMS/lib/python3.7/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)_versionZread_limitspagestream)	r   r   r   r   r   r   r   Z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<ZMessageDatezMessageDate>Z	PageTokenr   ZPageSizeGET)methoduriparams)	r   Zofr   iso8601_dater   r   r   NotificationPager   )
r   r   r   r   r   Z
page_tokenZ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   domainZtwiliorequestr&   r   )r   
target_urlr(   r   r   r   get_page   s    

zNotificationList.get_pagec             C   s   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   s
    	zNotificationList.getc             C   s   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   r-   )r.   r   r   )r   r-   r   r   r   __call__   s
    	zNotificationList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Api.V2010.NotificationList>r   )r   r   r   r   __repr__   s    zNotificationList.__repr__)__name__
__module____qualname__r   r   Zunsetr   r   r   r,   r/   r0   r1   __classcell__r   r   )r   r   r	      s   !
r	   c                   s,   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   r(   Zsolution)r   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
   r   )NotificationInstancer   r   )r   payloadr   r   r   get_instance   s
    	zNotificationPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z#<Twilio.Api.V2010.NotificationPage>r   )r   r   r   r   r1      s    zNotificationPage.__repr__)r2   r3   r4   r   r8   r1   r5   r   r   )r   r   r&      s   r&   c                   s,   e Zd Z fddZdd Zdd Z  ZS )r.   c                s2   t t| | |||d| _djf | 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
   r   r-   zA/Accounts/{account_sid}/Calls/{call_sid}/Notifications/{sid}.jsonN)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 )z
        Fetch the NotificationInstance

        :returns: The fetched NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        r!   )r"   r#   r
   r   r-   )r
   r   r-   )r   fetchr   r6   r   )r   r7   r   r   r   r9     s    zNotificationContext.fetchc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>  s    z/NotificationContext.__repr__.<locals>.<genexpr>z)<Twilio.Api.V2010.NotificationContext {}>)joinr   itemsr   )r   contextr   r   r   r1     s    zNotificationContext.__repr__)r2   r3   r4   r   r9   r1   r5   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 )-r6   Nc                s   t t| | |d|d|dt|dt|d|d|dt|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#   )r
   rB   r   rC   rD   rE   r   r   rF   rG   rH   rI   rJ   rK   rL   r-   r#   N)r
   r   r-   )	r   r6   r   r/   r   Zrfc2822_datetime_properties_contextr   )r   r   r7   r
   r   r-   )r   r   r   r   "  s,    zNotificationInstance.__init__c             C   s6   | j dkr0t| 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
   r   r-   )rN   r.   r   r   )r   r   r   r   _proxyH  s    	
zNotificationInstance._proxyc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r
   )rM   )r   r   r   r   r
   Z  s    z NotificationInstance.account_sidc             C   s
   | j d S )zq
        :returns: The API version used to create the Call Notification resource
        :rtype: unicode
        rB   )rM   )r   r   r   r   rB   b  s    z NotificationInstance.api_versionc             C   s
   | j d S )zg
        :returns: The SID of the Call the resource is associated with
        :rtype: unicode
        r   )rM   )r   r   r   r   r   j  s    zNotificationInstance.call_sidc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        rC   )rM   )r   r   r   r   rC   r  s    z!NotificationInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rD   )rM   )r   r   r   r   rD   z  s    z!NotificationInstance.date_updatedc             C   s
   | j d S )zi
        :returns: A unique error code corresponding to the notification
        :rtype: unicode
        rE   )rM   )r   r   r   r   rE     s    zNotificationInstance.error_codec             C   s
   | j d S )zH
        :returns: An integer log level
        :rtype: unicode
        r   )rM   )r   r   r   r   r     s    zNotificationInstance.logc             C   s
   | j d S )z\
        :returns: The date the notification was generated
        :rtype: datetime
        r   )rM   )r   r   r   r   r     s    z!NotificationInstance.message_datec             C   s
   | j d S )zP
        :returns: The text of the notification
        :rtype: unicode
        rF   )rM   )r   r   r   r   rF     s    z!NotificationInstance.message_textc             C   s
   | j d S )zc
        :returns: A URL for more information about the error code
        :rtype: unicode
        rG   )rM   )r   r   r   r   rG     s    zNotificationInstance.more_infoc             C   s
   | j d S )zY
        :returns: HTTP method used with the request url
        :rtype: unicode
        rH   )rM   )r   r   r   r   rH     s    z#NotificationInstance.request_methodc             C   s
   | j d S )zg
        :returns: URL of the resource that generated the notification
        :rtype: unicode
        rI   )rM   )r   r   r   r   rI     s    z NotificationInstance.request_urlc             C   s
   | j d S )zf
        :returns: Twilio-generated HTTP variables sent to the server
        :rtype: unicode
        rJ   )rM   )r   r   r   r   rJ     s    z&NotificationInstance.request_variablesc             C   s
   | j d S )zY
        :returns: The HTTP body returned by your server
        :rtype: unicode
        rK   )rM   )r   r   r   r   rK     s    z"NotificationInstance.response_bodyc             C   s
   | j d S )z\
        :returns: The HTTP headers returned by your server
        :rtype: unicode
        rL   )rM   )r   r   r   r   rL     s    z%NotificationInstance.response_headersc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r-   )rM   )r   r   r   r   r-     s    zNotificationInstance.sidc             C   s
   | j d S )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r#   )rM   )r   r   r   r   r#     s    zNotificationInstance.uric             C   s
   | j  S )z
        Fetch the NotificationInstance

        :returns: The fetched NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        )rO   r9   )r   r   r   r   r9     s    zNotificationInstance.fetchc             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r:   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r;   r<   r=   r   r   r   r>     s    z0NotificationInstance.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.NotificationInstance {}>)r?   r   r@   r   )r   rA   r   r   r   r1     s    zNotificationInstance.__repr__)N)r2   r3   r4   r   propertyrO   r
   rB   r   rC   rD   rE   r   r   rF   rG   rH   rI   rJ   rK   rL   r-   r#   r9   r1   r5   r   r   )r   r   r6      s*   &	r6   N)__doc__Ztwilio.baser   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r	   r&   r.   r6   r   r   r   r   <module>   s    2-0