o
    f>h;                     @   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                       sR   e Zd ZG dd deZ	 dedeeef def fddZ	defd	d
Z
  ZS )FeedbackInstancec                   @   .   e Zd ZdZdeeef f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   4   | d| _| d| _| d| _| d| _d S N
message_idscore
session_idtextgetr   r   r   r   selfr    r   _/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/assistants/v1/assistant/feedback.py__init__#      zBFeedbackInstance.AssistantsV1ServiceCreateFeedbackRequest.__init__c                 C      | j | j| j| jdS Nr   r   r   r   r$   r   r   r   r   to_dict*   
   zAFeedbackInstance.AssistantsV1ServiceCreateFeedbackRequest.to_dictN	__name__
__module____qualname____doc__r   strr   r    r&   r   r   r   r   (AssistantsV1ServiceCreateFeedbackRequest       r.   versionr   idc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
t|d	| _t|d
| _d|i| _d S )Nassistant_idr1   account_siduser_sidr   r   r   r   date_createddate_updated)superr    r   r2   r1   r3   r4   r   r   r   r   r
   iso8601_datetimer5   r6   	_solution)r   r0   r   r1   	__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 {}>)joinr9   itemsr?   )r   contextr   r   r   __repr__U   s   
zFeedbackInstance.__repr__)r)   r*   r+   objectr.   r   r   r-   r   r    rG   __classcell__r   r   r:   r   r      s
    "r   c                   @   s4   e Zd Zdeeef defddZdefddZdS )FeedbackPager   r<   c                 C   s   t | j|| jd dS )zn
        Build an instance of FeedbackInstance

        :param payload: Payload response from the API
        r1   r1   )r   _versionr9   r   r   r   r   get_instancea   s   zFeedbackPage.get_instancec                 C      dS )r=   z#<Twilio.Assistants.V1.FeedbackPage>r   r%   r   r   r   rG   i      zFeedbackPage.__repr__N)	r)   r*   r+   r   r-   r   r   rM   rG   r   r   r   r   rJ   _   s    rJ   c                	       s  e Zd ZG dd deZdedef fddZdedefd	d
Z	dedefddZ
		d%dee dee dee fddZ		d%dee dee dee fddZ		d%dee dee dee fddZ		d%dee dee dee fddZejejejfdeeef deeef deeef defddZejejejfdeeef deeef deeef defddZdedefdd Zdedefd!d"Zdefd#d$Z  ZS )&FeedbackListc                   @   r   )z5FeedbackList.AssistantsV1ServiceCreateFeedbackRequestr   r   c                 C   r   r   r   r   r   r   r   r    |   r!   z>FeedbackList.AssistantsV1ServiceCreateFeedbackRequest.__init__c                 C   r"   r#   r$   r%   r   r   r   r&      r'   z=FeedbackList.AssistantsV1ServiceCreateFeedbackRequest.to_dictNr(   r   r   r   r   r.   t   r/   r.   r0   r1   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the FeedbackList

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

        r1   z/Assistants/{id}/FeedbacksNr   )r7   r    r9   r?   _uri)r   r0   r1   r:   r   r   r       s   zFeedbackList.__init__-assistants_v1_service_create_feedback_requestr<   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headersr1   rK   )r&   r   ofrL   createrQ   r   r9   r   rR   r[   r\   r   r   r   r   r^      s   
zFeedbackList.createc                    sZ   |  }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
        rS   rT   rU   rV   rW   rX   Nr1   rK   )r&   r   r]   rL   create_asyncrQ   r   r9   r_   r   r   r   r`      s   
zFeedbackList.create_asyncNlimit	page_sizec                 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
        rb   rb   ra   )rL   read_limitspagestreamr   ra   rb   limitsre   r   r   r   rf      s   zFeedbackList.streamc                    s8   | 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
        rb   rc   Nra   )rL   rd   
page_asyncstream_asyncrg   r   r   r   rj      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
        ra   rb   )listrf   r   ra   rb   r   r   r   rl      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>rk   N)rj   rm   r   r   r   
list_async  s   
zFeedbackList.list_async
page_tokenpage_numberc                 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
        	PageTokenr   PageSizerS   rT   rU   rV   GETrY   rZ   paramsr\   )r   r]   rL   re   rQ   rJ   r9   r   rq   rr   rb   r[   r\   responser   r   r   re   4  s   
zFeedbackList.pagec                    sV   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
        rs   rS   rT   rU   rV   rv   rw   N)r   r]   rL   ri   rQ   rJ   r9   ry   r   r   r   ri   U  s   
zFeedbackList.page_async
target_urlc                 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
        rv   )rL   domaintwiliorequestrJ   r9   r   r{   rz   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
        rv   N)rL   r|   r}   request_asyncrJ   r9   r   r   r   r   get_page_async  s   	zFeedbackList.get_page_asyncc                 C   rN   )r=   z#<Twilio.Assistants.V1.FeedbackList>r   r%   r   r   r   rG     rO   zFeedbackList.__repr__)NN)r)   r*   r+   rH   r.   r   r-   r    r   r^   r`   r   intr   rf   r	   rj   r   rl   rp   r   unsetr   rJ   re   ri   r   r   rG   rI   r   r   r:   r   rP   r   s    









#



!rP   N)r,   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rJ   rP   r   r   r   r   <module>   s    $F