U
    ^g%i*                     @   s   d Z ddlmZmZmZmZ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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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)values)InstanceResource)ListResource)Version)Pagec                       sB   e Zd ZdZeeeef eed fddZedddZ	  Z
S )EventInstancez
    :ivar request: Contains a dictionary representing the request of the call.
    :ivar response: Contains a dictionary representing the call response, including a list of the call events.
    )versionpayloadaccount_sidcall_sidc                    s4   t  | |d| _|d| _||d| _d S )Nrequestresponser   r   )super__init__getr   r   	_solution)selfr   r   r   r   	__class__ g/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/api/v2010/account/call/event.pyr      s    zEventInstance.__init__returnc                 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vr   r   r   	<genexpr>1   s     z)EventInstance.__repr__.<locals>.<genexpr>z#<Twilio.Api.V2010.EventInstance {}>)joinr   itemsr#   )r   contextr   r   r   __repr__+   s    zEventInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r+   __classcell__r   r   r   r   r      s    
  r   c                   @   s2   e Zd Zeeef edddZedddZdS )	EventPage)r   r    c                 C   s   t | j|| jd | jd dS )zk
        Build an instance of EventInstance

        :param payload: Payload response from the API
        r   r   r   )r   _versionr   )r   r   r   r   r   get_instance7   s    zEventPage.get_instancer   c                 C   s   dS )r!   z<Twilio.Api.V2010.EventPage>r   r   r   r   r   r+   D   s    zEventPage.__repr__N)	r,   r-   r.   r   r0   r   r   r4   r+   r   r   r   r   r2   5   s   r2   c                       sH  e Zd Zeeed fddZdee ee ee	 dddZ
dee ee ee	 ddd	Zdee ee ee	 dd
dZdee ee ee	 dddZejejejfeeef eeef eeef edddZejejej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dddZ  ZS )	EventList)r   r   r   c                    s,   t  | ||d| _djf | j| _dS )z
        Initialize the EventList

        :param version: Version that contains the resource
        :param account_sid: The unique SID identifier of the Account.
        :param call_sid: The unique SID identifier of the Call.

        r   z4/Accounts/{account_sid}/Calls/{call_sid}/Events.jsonN)r   r   r   r#   _uri)r   r   r   r   r   r   r   r   O   s    	zEventList.__init__N)limit	page_sizer    c                 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 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
        r9   r9   r8   )r3   read_limitspagestreamr   r8   r9   Zlimitsr<   r   r   r   r=   c   s    zEventList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )aj  
        Asynchronously 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 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
        r9   r:   Nr8   )r3   r;   
page_asyncstream_asyncr>   r   r   r   r@   |   s    zEventList.stream_asyncc                 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 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
        r8   r9   )listr=   r   r8   r9   r   r   r   rB      s    zEventList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously 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 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 )Nr   )r$   recordr   r   r   
<listcomp>   s   z(EventList.list_async.<locals>.<listcomp>rA   N)r@   rC   r   r   r   
list_async   s    
zEventList.list_async)
page_tokenpage_numberr9   r    c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )ao  
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :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 EventInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r	   ofr3   r<   r7   r2   r   r   rG   rH   r9   datarS   r   r   r   r   r<      s       zEventList.pagec                    sT   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a~  
        Asynchronously retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :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 EventInstance
        rI   rJ   rK   rL   rM   rN   rO   N)r	   rT   r3   r?   r7   r2   r   rU   r   r   r   r?      s       zEventList.page_async)
target_urlr    c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of EventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EventInstance
        rN   )r3   domaintwilior   r2   r   r   rW   r   r   r   r   get_page  s    	zEventList.get_pagec                    s(   | j jjd|I dH }t| j || jS )z
        Asynchronously retrieve a specific page of EventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EventInstance
        rN   N)r3   rX   rY   Zrequest_asyncr2   r   rZ   r   r   r   get_page_async  s    	zEventList.get_page_asyncr   c                 C   s   dS )r!   z<Twilio.Api.V2010.EventList>r   r5   r   r   r   r+   $  s    zEventList.__repr__)NN)NN)NN)NN)r,   r-   r.   r   r0   r   r   intr   r   r=   r   r@   r   rB   rF   r	   unsetr   objectr2   r<   r?   r[   r\   r+   r1   r   r   r   r   r6   M   sd           


#


!r6   N)r/   typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r2   r6   r   r   r   r   <module>   s   $