B
    `                 @   sh   d 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dS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )values)InstanceResource)ListResource)Pagec                   sV   e Zd Z fddZdddZdddZejejejfdd	Zd
d Z	dd Z
  ZS )	EventListc                s0   t t| | ||d| _djf | j| _dS )a  
        Initialize the EventList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created this resource
        :param call_sid: The unique string that identifies this resource

        :returns: twilio.rest.api.v2010.account.call.event.EventList
        :rtype: twilio.rest.api.v2010.account.call.event.EventList
        )account_sidcall_sidz4/Accounts/{account_sid}/Calls/{call_sid}/Events.jsonN)superr   __init__	_solutionformat_uri)selfversionr   r   )	__class__ W/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/api/v2010/account/call/event.pyr
      s    zEventList.__init__Nc             C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams EventInstance 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 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.event.EventInstance]
        	page_size)r   limit)_versionZread_limitspagestream)r   r   r   Zlimitsr   r   r   r   r   "   s    zEventList.streamc             C   s   t | j||dS )a`  
        Lists EventInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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.event.EventInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   9   s    zEventList.listc             C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :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 EventInstance
        :rtype: twilio.rest.api.v2010.account.call.event.EventPage
        )Z	PageTokenr   ZPageSizeGET)methoduriparams)r   Zofr   r   r   	EventPager   )r   Z
page_tokenZpage_numberr   dataresponser   r   r   r   K   s    zEventList.pagec             C   s"   | j jjd|}t| j || jS )a6  
        Retrieve a specific page of EventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EventInstance
        :rtype: twilio.rest.api.v2010.account.call.event.EventPage
        r   )r   domainZtwiliorequestr   r   )r   
target_urlr   r   r   r   get_page^   s    

zEventList.get_pagec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.EventList>r   )r   r   r   r   __repr__o   s    zEventList.__repr__)NN)NN)__name__
__module____qualname__r
   r   r   r   Zunsetr   r#   r$   __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 EventPage

        :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 this resource
        :param call_sid: The unique string that identifies this resource

        :returns: twilio.rest.api.v2010.account.call.event.EventPage
        :rtype: twilio.rest.api.v2010.account.call.event.EventPage
        N)r	   r   r
   r   )r   r   r   Zsolution)r   r   r   r
   {   s    zEventPage.__init__c             C   s   t | j|| jd | jd dS )a  
        Build an instance of EventInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.call.event.EventInstance
        :rtype: twilio.rest.api.v2010.account.call.event.EventInstance
        r   r   )r   r   )EventInstancer   r   )r   payloadr   r   r   get_instance   s
    	zEventPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.EventPage>r   )r   r   r   r   r$      s    zEventPage.__repr__)r%   r&   r'   r
   r+   r$   r(   r   r   )r   r   r   y   s   r   c                   s<   e Zd Z fddZedd Zedd Zdd Z  ZS )	r)   c                s>   t t| | |d|dd| _d| _||d| _dS )z
        Initialize the EventInstance

        :returns: twilio.rest.api.v2010.account.call.event.EventInstance
        :rtype: twilio.rest.api.v2010.account.call.event.EventInstance
        r!   r   )r!   r   N)r   r   )r	   r)   r
   get_properties_contextr   )r   r   r*   r   r   )r   r   r   r
      s    zEventInstance.__init__c             C   s
   | j d S )z>
        :returns: Call Request.
        :rtype: dict
        r!   )r-   )r   r   r   r   r!      s    zEventInstance.requestc             C   s
   | j d S )zK
        :returns: Call Response with Events.
        :rtype: dict
        r   )r-   )r   r   r   r   r      s    zEventInstance.responsec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z <Twilio.Api.V2010.EventInstance>r   )r   r   r   r   r$      s    zEventInstance.__repr__)	r%   r&   r'   r
   propertyr!   r   r$   r(   r   r   )r   r   r)      s   r)   N)__doc__Ztwilio.baser   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r   r   r)   r   r   r   r   <module>   s   j-