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 ddlmZ G d	d
 d
e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 - Flex
    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)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZdZdeeeef ee d fddZ	e
dddd	Zejfeeeeeef d d
ddZejfeeeeeef d d
ddZedddZ  ZS )AssessmentsInstancea  
    :ivar account_sid: The unique SID identifier of the Account.
    :ivar assessment_sid: The SID of the assessment
    :ivar offset: Offset of the conversation
    :ivar report: The flag indicating if this assessment is part of report
    :ivar weight: The weightage given to this comment
    :ivar agent_id: The id of the Agent
    :ivar segment_id: Segment Id of conversation
    :ivar user_name: The name of the user.
    :ivar user_email: The email id of the user.
    :ivar answer_text: The answer text selected by user
    :ivar answer_id: The id of the answer selected by user
    :ivar assessment: Assessment Details associated with an assessment
    :ivar timestamp:
    :ivar url:
    N)versionpayloadassessment_sidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _|d| _|d| _|d| _d|p| ji| _d | _d S )Naccount_sidr   offsetreportweightagent_id
segment_id	user_name
user_emailanswer_text	answer_id
assessment	timestampurl)super__init__getr   r   r   r   r   r   r   r   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__ b/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/flex_api/v1/assessments.pyr!   *   s&     zAssessmentsInstance.__init__AssessmentsContextreturnc                 C   s&   | j dkr t| j| jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: AssessmentsContext for this AssessmentsInstance
        Nr   r   )r$   r*   _versionr#   r%   r(   r(   r)   _proxyF   s    
zAssessmentsInstance._proxyr   r   r   authorizationr,   c                 C   s   | j j||||dS )[  
        Update the AssessmentsInstance

        :param offset: The offset of the conversation
        :param answer_text: The answer text selected by user
        :param answer_id: The id of the answer selected by user
        :param authorization: The Authorization HTTP request header

        :returns: The updated AssessmentsInstance
        r   r   r   r2   )r0   updater%   r   r   r   r2   r(   r(   r)   r5   U   s    zAssessmentsInstance.updatec                    s   | j j||||dI dH S )u  
        Asynchronous coroutine to update the AssessmentsInstance

        :param offset: The offset of the conversation
        :param answer_text: The answer text selected by user
        :param answer_id: The id of the answer selected by user
        :param authorization: The Authorization HTTP request header

        :returns: The updated AssessmentsInstance
        r4   N)r0   update_asyncr6   r(   r(   r)   r8   m   s    z AssessmentsInstance.update_asyncc                 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/AssessmentsInstance.__repr__.<locals>.<genexpr>z*<Twilio.FlexApi.V1.AssessmentsInstance {}>joinr#   itemsr=   r%   contextr(   r(   r)   __repr__   s    zAssessmentsInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r!   propertyr0   r	   unsetfloatr   objectr5   r8   rH   __classcell__r(   r(   r&   r)   r      s4    


r   c                       sz   e Zd Zeed fddZejfeeee	ee
f edddZejfeeee	ee
f edddZed	d
dZ  ZS )r*   )r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the AssessmentsContext

        :param version: Version that contains the resource
        :param assessment_sid: The SID of the assessment to be modified
        r   z8/Insights/QualityManagement/Assessments/{assessment_sid}N)r    r!   r#   r=   _uri)r%   r   r   r&   r(   r)   r!      s     zAssessmentsContext.__init__r1   c                 C   sx   t |||d}t i }|t jks<t|tr4|r<||d< d|d< d|d< | jjd| j||d}t| j|| j	d	 d
S )r3   Offset
AnswerTextAnswerIdAuthorization!application/x-www-form-urlencodedContent-Typeapplication/jsonAcceptPOSTmethoduridataheadersr   r-   )
r	   ofrO   
isinstancerM   r.   r5   rS   r   r#   r%   r   r   r   r2   ra   rb   r   r(   r(   r)   r5      s6    
     zAssessmentsContext.updatec                    s~   t |||d}t i }|t jks<t|tr4|r<||d< d|d< d|d< | jjd| j||dI d	H }t| j|| j	d
 dS )r7   rT   rX   rY   rZ   r[   r\   r]   r^   Nr   r-   )
r	   rc   rO   rd   rM   r.   r8   rS   r   r#   re   r(   r(   r)   r8      s6    
     zAssessmentsContext.update_asyncr+   c                 C   s$   d dd | j D }d|S )r9   r:   c                 s   s   | ]\}}d  ||V  qdS r;   r<   r>   r(   r(   r)   rB     s     z.AssessmentsContext.__repr__.<locals>.<genexpr>z)<Twilio.FlexApi.V1.AssessmentsContext {}>rC   rF   r(   r(   r)   rH      s    zAssessmentsContext.__repr__)rI   rJ   rK   r   rM   r!   r	   rO   rP   r   rQ   r   r5   r8   rH   rR   r(   r(   r&   r)   r*      s$   
2
-r*   c                   @   s2   e Zd Zeeef edddZedddZdS )AssessmentsPage)r   r,   c                 C   s   t | j|S )zq
        Build an instance of AssessmentsInstance

        :param payload: Payload response from the API
        )r   r.   )r%   r   r(   r(   r)   get_instance  s    zAssessmentsPage.get_instancer+   c                 C   s   dS )r9   z#<Twilio.FlexApi.V1.AssessmentsPage>r(   r/   r(   r(   r)   rH     s    zAssessmentsPage.__repr__N)	rI   rJ   rK   r   rM   r   r   rg   rH   r(   r(   r(   r)   rf     s   rf   c                       s  e Zd Zed fddZejfeeeeeeeeeee	ee
f edddZejfeeeeeeeeeee	ee
f edddZejejd	d	fe	ee
f e	ee
f ee ee ee d
ddZejejd	d	fe	ee
f e	ee
f ee ee ee d
ddZejejd	d	fe	ee
f e	ee
f ee ee ee d
ddZejejd	d	fe	ee
f e	ee
f ee ee ee d
ddZejejejejejfe	ee
f e	ee
f e	ee
f e	ee
f e	ee
f edddZejejejejejfe	ee
f e	ee
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edddZeedd d!Zed"d#d$Z  Z S )%AssessmentsList)r   c                    s   t  | d| _dS )zm
        Initialize the AssessmentsList

        :param version: Version that contains the resource

        z'/Insights/QualityManagement/AssessmentsN)r    r!   rS   )r%   r   r&   r(   r)   r!     s    zAssessmentsList.__init__)category_sidcategory_namer   r   r   	metric_idmetric_namer   r   questionnaire_sidr2   r,   c                 C   sb   t |||||||||	|
d
}t |dd}d|d< d|d< | jjd| j||d}t| j|S )	a  
        Create the AssessmentsInstance

        :param category_sid: The SID of the category
        :param category_name: The name of the category
        :param segment_id: Segment Id of the conversation
        :param agent_id: The id of the Agent
        :param offset: The offset of the conversation.
        :param metric_id: The question SID selected for assessment
        :param metric_name: The question name of the assessment
        :param answer_text: The answer text selected by user
        :param answer_id: The id of the answer selected by user
        :param questionnaire_sid: Questionnaire SID of the associated question
        :param authorization: The Authorization HTTP request header

        :returns: The created AssessmentsInstance
        
ZCategorySidZCategoryName	SegmentIdZAgentIdrU   ZMetricIdZ
MetricNamerV   rW   ZQuestionnaireSidrY   rX   rZ   rZ   r[   r\   r]   r^   )r	   rc   r.   createrS   r   r%   ri   rj   r   r   r   rk   rl   r   r   rm   r2   ra   rb   r   r(   r(   r)   rq   &  s6        zAssessmentsList.createc                    sh   t |||||||||	|
d
}t |dd}d|d< d|d< | jjd| j||dI d	H }t| j|S )
a  
        Asynchronously create the AssessmentsInstance

        :param category_sid: The SID of the category
        :param category_name: The name of the category
        :param segment_id: Segment Id of the conversation
        :param agent_id: The id of the Agent
        :param offset: The offset of the conversation.
        :param metric_id: The question SID selected for assessment
        :param metric_name: The question name of the assessment
        :param answer_text: The answer text selected by user
        :param answer_id: The id of the answer selected by user
        :param questionnaire_sid: Questionnaire SID of the associated question
        :param authorization: The Authorization HTTP request header

        :returns: The created AssessmentsInstance
        rn   rY   rp   rZ   r[   r\   r]   r^   N)r	   rc   r.   create_asyncrS   r   rr   r(   r(   r)   rs   e  s6        zAssessmentsList.create_asyncN)r2   r   limit	page_sizer,   c                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams AssessmentsInstance 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 str authorization: The Authorization HTTP request header
        :param str segment_id: The id of the segment.
        :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
        ru   r2   r   ru   rt   )r.   read_limitspagestreamr%   r2   r   rt   ru   Zlimitsrx   r(   r(   r)   ry     s    zAssessmentsList.streamc                    s:   | j ||}| j|||d dI dH }| j ||d S )a  
        Asynchronously streams AssessmentsInstance 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 str authorization: The Authorization HTTP request header
        :param str segment_id: The id of the segment.
        :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
        ru   rv   Nrt   )r.   rw   
page_asyncstream_asyncrz   r(   r(   r)   r|     s    zAssessmentsList.stream_asyncc                 C   s   t | j||||dS )a|  
        Lists AssessmentsInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str authorization: The Authorization HTTP request header
        :param str segment_id: The id of the segment.
        :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
        r2   r   rt   ru   )listry   r%   r2   r   rt   ru   r(   r(   r)   r~     s    zAssessmentsList.listc                    s(   dd | j ||||dI dH 2 I dH S )a  
        Asynchronously lists AssessmentsInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str authorization: The Authorization HTTP request header
        :param str segment_id: The id of the segment.
        :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.AssessmentsList.list_async.<locals>.<listcomp>r}   N)r|   r   r(   r(   r)   
list_async  s    
zAssessmentsList.list_async)r2   r   
page_tokenpage_numberru   r,   c           	      C   sP   t |||||d}t |dd}d|d< | jjd| j||d}t| j|S )a  
        Retrieve a single page of AssessmentsInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param segment_id: The id of the segment.
        :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 AssessmentsInstance
        rX   ro   Z	PageTokenr   ZPageSizerY   rp   r[   r\   GETr_   r`   paramsrb   )r	   rc   r.   rx   rS   rf   	r%   r2   r   r   r   ru   ra   rb   responser(   r(   r)   rx   '  s*    
   zAssessmentsList.pagec           	         sV   t |||||d}t |dd}d|d< | jjd| j||dI dH }t| j|S )	a   
        Asynchronously retrieve a single page of AssessmentsInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param segment_id: The id of the segment.
        :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 AssessmentsInstance
        r   rY   rp   r[   r\   r   r   N)r	   rc   r.   r{   rS   rf   r   r(   r(   r)   r{   S  s*    
   zAssessmentsList.page_async)
target_urlr,   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of AssessmentsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AssessmentsInstance
        r   )r.   domaintwiliorequestrf   r%   r   r   r(   r(   r)   get_page  s    	zAssessmentsList.get_pagec                    s$   | j jjd|I dH }t| j |S )a
  
        Asynchronously retrieve a specific page of AssessmentsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AssessmentsInstance
        r   N)r.   r   r   Zrequest_asyncrf   r   r(   r(   r)   get_page_async  s    	zAssessmentsList.get_page_async)r   r,   c                 C   s   t | j|dS zz
        Constructs a AssessmentsContext

        :param assessment_sid: The SID of the assessment to be modified
        r-   r*   r.   r%   r   r(   r(   r)   r"     s    zAssessmentsList.getc                 C   s   t | j|dS r   r   r   r(   r(   r)   __call__  s    zAssessmentsList.__call__r+   c                 C   s   dS )r9   z#<Twilio.FlexApi.V1.AssessmentsList>r(   r/   r(   r(   r)   rH     s    zAssessmentsList.__repr__)!rI   rJ   rK   r   r!   r	   rO   rM   rP   r   rQ   r   rq   rs   r   intr   ry   r   r|   r   r~   r   rf   rx   r{   r   r   r*   r"   r   rH   rR   r(   r(   r&   r)   rh     s   
K
A

#

#

"

#




.




,rh   N)rL   typingr   r   r   r   r   r   r   Ztwilio.baser	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r*   rf   rh   r(   r(   r(   r)   <module>   s   $ww