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                       sL   e Zd ZG dd deZeeeef ed fddZ	edddZ
  ZS )	FeedbackInstancec                   @   s.   e Zd ZdZeeef dddZdd ZdS )z9FeedbackInstance.AssistantsV1ServiceCreateFeedbackRequest
        :ivar message_id: The message ID.
        :ivar score: The score to be given(0-1).
        :ivar session_id: The Session ID.
        :ivar text: The text to be given as feedback.
        payloadc                 C   s4   | d| _| d| _| d| _| d| _d S N
message_idscore
session_idtextgetr   r   r   r   selfr    r   k/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/assistants/v1/assistant/feedback.py__init__#   s    zBFeedbackInstance.AssistantsV1ServiceCreateFeedbackRequest.__init__c                 C   s   | j | j| j| jdS Nr   r   r   r   r!   r   r   r   r   to_dict*   s
    zAFeedbackInstance.AssistantsV1ServiceCreateFeedbackRequest.to_dictN	__name__
__module____qualname____doc__r   strr   r   r#   r   r   r   r   (AssistantsV1ServiceCreateFeedbackRequest   s   r*   )versionr   idc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
t|d	| _t|d
| _d|i| _d S )Nassistant_idr,   account_siduser_sidr   r   r   r   date_createddate_updated)superr   r   r-   r,   r.   r/   r   r   r   r   r
   Ziso8601_datetimer0   r1   	_solution)r   r+   r   r,   	__class__r   r   r   ?   s$     zFeedbackInstance.__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>[   s     z,FeedbackInstance.__repr__.<locals>.<genexpr>z*<Twilio.Assistants.V1.FeedbackInstance {}>)joinr3   itemsr:   )r   contextr   r   r   __repr__U   s    zFeedbackInstance.__repr__)r%   r&   r'   objectr*   r   r   r)   r   r   rB   __classcell__r   r   r4   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 )FeedbackPage)r   r7   c                 C   s   t | j|| jd dS )zn
        Build an instance of FeedbackInstance

        :param payload: Payload response from the API
        r,   r,   )r   _versionr3   r   r   r   r   get_instancea   s    zFeedbackPage.get_instancer6   c                 C   s   dS )r8   z#<Twilio.Assistants.V1.FeedbackPage>r   r"   r   r   r   rB   i   s    zFeedbackPage.__repr__N)	r%   r&   r'   r   r)   r   r   rH   rB   r   r   r   r   rE   _   s   rE   c                       sv  e Zd ZG dd deZeed fddZeedddZ	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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 )&FeedbackListc                   @   s.   e Zd ZdZeeef dddZdd ZdS )z5FeedbackList.AssistantsV1ServiceCreateFeedbackRequestr   r   c                 C   s4   | d| _| d| _| d| _| d| _d S r   r   r   r   r   r   r   |   s    z>FeedbackList.AssistantsV1ServiceCreateFeedbackRequest.__init__c                 C   s   | j | j| j| jdS r    r!   r"   r   r   r   r#      s
    z=FeedbackList.AssistantsV1ServiceCreateFeedbackRequest.to_dictNr$   r   r   r   r   r*   t   s   r*   )r+   r,   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the FeedbackList

        :param version: Version that contains the resource
        :param id: The assistant ID.

        r,   z/Assistants/{id}/FeedbacksN)r2   r   r3   r:   _uri)r   r+   r,   r4   r   r   r      s
     zFeedbackList.__init__)-assistants_v1_service_create_feedback_requestr7   c                 C   sR   |  }tddi}d|d< d|d< | jjd| j||d}t| j|| jd dS )	z
        Create the FeedbackInstance

        :param assistants_v1_service_create_feedback_request:

        :returns: The created FeedbackInstance
        Content-Type!application/x-www-form-urlencodedapplication/jsonAcceptPOSTmethoduridataheadersr,   rF   )r#   r   ofrG   createrJ   r   r3   r   rK   rT   rU   r   r   r   r   rW      s       zFeedbackList.createc                    sX   |  }tddi}d|d< d|d< | jjd| j||dI dH }t| j|| jd d	S )
z
        Asynchronously create the FeedbackInstance

        :param assistants_v1_service_create_feedback_request:

        :returns: The created FeedbackInstance
        rL   rM   rN   rO   rP   rQ   Nr,   rF   )r#   r   rV   rG   create_asyncrJ   r   r3   rX   r   r   r   rY      s       zFeedbackList.create_asyncN)limit	page_sizer7   c                 C   s0   | j ||}| j|d d}| j ||d S )a^  
        Streams FeedbackInstance 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[   rZ   )rG   read_limitspagestreamr   rZ   r[   Zlimitsr^   r   r   r   r_      s    zFeedbackList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )am  
        Asynchronously streams FeedbackInstance 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\   NrZ   )rG   r]   
page_asyncstream_asyncr`   r   r   r   rb      s    zFeedbackList.stream_asyncc                 C   s   t | j||dS )a  
        Lists FeedbackInstance 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
        rZ   r[   )listr_   r   rZ   r[   r   r   r   rd      s    zFeedbackList.listc                    s$   dd | j ||dI dH 2 I dH S )a
  
        Asynchronously lists FeedbackInstance 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+FeedbackList.list_async.<locals>.<listcomp>rc   N)rb   re   r   r   r   
list_async  s    
zFeedbackList.list_async)
page_tokenpage_numberr[   r7   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )au  
        Retrieve a single page of FeedbackInstance 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 FeedbackInstance
        Z	PageTokenr   ZPageSizerL   rM   rN   rO   GETrR   rS   paramsrU   )r   rV   rG   r^   rJ   rE   r3   r   ri   rj   r[   rT   rU   responser   r   r   r^   4  s       zFeedbackList.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 FeedbackInstance 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 FeedbackInstance
        rk   rL   rM   rN   rO   rl   rm   N)r   rV   rG   ra   rJ   rE   r3   ro   r   r   r   ra   U  s       zFeedbackList.page_async)
target_urlr7   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of FeedbackInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FeedbackInstance
        rl   )rG   domaintwiliorequestrE   r3   r   rq   rp   r   r   r   get_pagev  s    	zFeedbackList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of FeedbackInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FeedbackInstance
        rl   N)rG   rr   rs   Zrequest_asyncrE   r3   ru   r   r   r   get_page_async  s    	zFeedbackList.get_page_asyncr6   c                 C   s   dS )r8   z#<Twilio.Assistants.V1.FeedbackList>r   r"   r   r   r   rB     s    zFeedbackList.__repr__)NN)NN)NN)NN)r%   r&   r'   rC   r*   r   r)   r   r   rW   rY   r   intr   r_   r	   rb   r   rd   rh   r   unsetr   rE   r^   ra   rv   rw   rB   rD   r   r   r4   r   rI   r   sr           


#


!rI   N)r(   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   rE   rI   r   r   r   r   <module>   s   $F