U
    ^g%i.                     @   s   d Z ddl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 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 - Assistants
    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.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceResource)ListResource)Version)Pagec                       s@   e Zd ZdZeeeef ed fddZedddZ	  Z
S )MessageInstancea  
    :ivar id: The message ID.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resource.
    :ivar assistant_id: The Assistant ID.
    :ivar session_id: The Session ID.
    :ivar identity: The identity of the user.
    :ivar role: The role of the user associated with the message.
    :ivar content: The content of the message.
    :ivar meta: The metadata of the message.
    :ivar date_created: The date and time in GMT when the Message was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the Message was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    )versionpayload
session_idc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
t|d	| _t|d
| _d|i| _d S )Nidaccount_sidassistant_idr   identityrolecontentmetadate_createddate_updated)super__init__getr   r   r   r   r   r   r   r   r
   Ziso8601_datetimer   r   	_solution)selfr   r   r   	__class__ h/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/assistants/v1/session/message.pyr   '   s$     zMessageInstance.__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>C   s     z+MessageInstance.__repr__.<locals>.<genexpr>z)<Twilio.Assistants.V1.MessageInstance {}>)joinr    itemsr*   )r!   contextr$   r$   r%   __repr__=   s    zMessageInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r2   __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 )MessagePage)r   r'   c                 C   s   t | j|| jd dS )zm
        Build an instance of MessageInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr    )r!   r   r$   r$   r%   get_instanceI   s
      zMessagePage.get_instancer&   c                 C   s   dS )r(   z"<Twilio.Assistants.V1.MessagePage>r$   r!   r$   r$   r%   r2   S   s    zMessagePage.__repr__N)	r3   r4   r5   r   r7   r   r   r;   r2   r$   r$   r$   r%   r9   G   s   
r9   c                       sF  e Zd Z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 )MessageList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the MessageList

        :param version: Version that contains the resource
        :param session_id: Session id or name

        r   z/Sessions/{session_id}/MessagesN)r   r   r    r*   _uri)r!   r   r   r"   r$   r%   r   ^   s
     zMessageList.__init__N)limit	page_sizer'   c                 C   s0   | j ||}| j|d d}| j ||d S )a]  
        Streams MessageInstance 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
        r@   r@   r?   )r:   read_limitspagestreamr!   r?   r@   ZlimitsrC   r$   r$   r%   rD   n   s    zMessageList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )al  
        Asynchronously streams MessageInstance 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
        r@   rA   Nr?   )r:   rB   
page_asyncstream_asyncrE   r$   r$   r%   rG      s    zMessageList.stream_asyncc                 C   s   t | j||dS )a  
        Lists MessageInstance 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
        r?   r@   )listrD   r!   r?   r@   r$   r$   r%   rI      s    zMessageList.listc                    s$   dd | j ||dI dH 2 I dH S )a	  
        Asynchronously lists MessageInstance 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*MessageList.list_async.<locals>.<listcomp>rH   N)rG   rJ   r$   r$   r%   
list_async   s    
zMessageList.list_async)
page_tokenpage_numberr@   r'   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )as  
        Retrieve a single page of MessageInstance 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 MessageInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofr:   rC   r>   r9   r    r!   rN   rO   r@   datarZ   responser$   r$   r%   rC      s       zMessageList.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 MessageInstance 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 MessageInstance
        rP   rQ   rR   rS   rT   rU   rV   N)r   r[   r:   rF   r>   r9   r    r\   r$   r$   r%   rF      s       zMessageList.page_async)
target_urlr'   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of MessageInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MessageInstance
        rU   )r:   domaintwiliorequestr9   r    r!   r_   r^   r$   r$   r%   get_page  s    	zMessageList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of MessageInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MessageInstance
        rU   N)r:   r`   ra   Zrequest_asyncr9   r    rc   r$   r$   r%   get_page_async#  s    	zMessageList.get_page_asyncr&   c                 C   s   dS )r(   z"<Twilio.Assistants.V1.MessageList>r$   r<   r$   r$   r%   r2   /  s    zMessageList.__repr__)NN)NN)NN)NN)r3   r4   r5   r   r7   r   r   intr   r   rD   r	   rG   r   rI   rM   r   unsetr   objectr9   rC   rF   rd   re   r2   r8   r$   r$   r"   r%   r=   \   sd           


#


!r=   N)r6   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r9   r=   r$   r$   r$   r%   <module>   s   $.