a
    !f[                     @   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
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)deserialize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| _t|d| _|d| _t|d| _	|d| _
|d| _|d| _|d	| _|d
| _|d| _|d| _t|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	   decimalr   r   r   r   r   r   r   r   r   r   r   r    	_solution_context)selfr   r   r   	__class__ d/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/flex_api/v1/assessments.pyr"   ,   s$    
zAssessmentsInstance.__init__AssessmentsContextreturnc                 C   s&   | j du 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+   _proxyH   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   r4   )r2   updater'   r   r   r   r4   r*   r*   r+   r7   W   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
        r6   N)r2   update_asyncr8   r*   r*   r+   r:   o   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>       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"   propertyr2   r
   unsetfloatr   objectr7   r:   rK   __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 i | 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__r3   c                 C   sL   t |||d}t d|i}| jjd| j||d}t| j|| jd dS )r5   Offset
AnswerTextAnswerIdAuthorizationPOSTmethoduridataheadersr   r/   )r
   ofr0   r7   rV   r   r%   r'   r   r   r   r4   r`   ra   r   r*   r*   r+   r7      s     
zAssessmentsContext.updatec                    sR   t |||d}t d|i}| jjd| j||dI dH }t| j|| jd dS )r9   rW   r[   r\   r]   Nr   r/   )r
   rb   r0   r:   rV   r   r%   rc   r*   r*   r+   r:      s     
zAssessmentsContext.update_asyncr-   c                 C   s$   d dd | j D }d|S )r;   r<   c                 s   s   | ]\}}d  ||V  qdS r=   r>   r@   r*   r*   r+   rD      rE   z.AssessmentsContext.__repr__.<locals>.<genexpr>z)<Twilio.FlexApi.V1.AssessmentsContext {}>rF   rI   r*   r*   r+   rK      s    zAssessmentsContext.__repr__)rL   rM   rN   r   rP   r"   r
   rR   rS   r   rT   r   r7   r:   rK   rU   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 )AssessmentsPage)r   r.   c                 C   s   t | j|S )zq
        Build an instance of AssessmentsInstance

        :param payload: Payload response from the API
        )r   r0   )r'   r   r*   r*   r+   get_instance   s    zAssessmentsPage.get_instancer-   c                 C   s   dS )r;   z#<Twilio.FlexApi.V1.AssessmentsPage>r*   r1   r*   r*   r+   rK     s    zAssessmentsPage.__repr__N)	rL   rM   rN   r   rP   r   r   re   rK   r*   r*   r*   r+   rd      s   rd   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"   rV   )r'   r   r(   r*   r+   r"     s    zAssessmentsList.__init__)category_sidcategory_namer   r   r   	metric_idmetric_namer   r   questionnaire_sidr4   r.   c                 C   sP   t |||||||||	|
d
}t d|i}| 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AgentIdrX   ZMetricIdZ
MetricNamerY   rZ   ZQuestionnaireSidr[   r\   r]   )r
   rb   r0   createrV   r   r'   rg   rh   r   r   r   ri   rj   r   r   rk   r4   r`   ra   r   r*   r*   r+   rn     s*    
zAssessmentsList.createc                    sV   t |||||||||	|
d
}t d|i}| 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
        rl   r[   r\   r]   N)r
   rb   r0   create_asyncrV   r   ro   r*   r*   r+   rp   O  s*    
zAssessmentsList.create_asyncN)r4   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
        rr   r4   r   rr   rq   )r0   read_limitspagestreamr'   r4   r   rq   rr   Zlimitsru   r*   r*   r+   rv     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
        rr   rs   Nrq   )r0   rt   
page_asyncstream_asyncrw   r*   r*   r+   ry     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
        r4   r   rq   rr   )listrv   r'   r4   r   rq   rr   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*   )rA   recordr*   r*   r+   
<listcomp>   s   z.AssessmentsList.list_async.<locals>.<listcomp>rz   N)ry   r|   r*   r*   r+   
list_async  s    
zAssessmentsList.list_async)r4   r   
page_tokenpage_numberrr   r.   c                 C   s6   t |||||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
        r[   rm   Z	PageTokenr   ZPageSizeGETr^   r_   params)r
   rb   r0   ru   rV   rd   r'   r4   r   r   r   rr   r`   responser*   r*   r+   ru   
  s    
zAssessmentsList.pagec                    s<   t |||||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   r   r   N)r
   rb   r0   rx   rV   rd   r   r*   r*   r+   rx   +  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   )r0   domaintwiliorequestrd   r'   r   r   r*   r*   r+   get_pageN  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)r0   r   r   Zrequest_asyncrd   r   r*   r*   r+   get_page_asyncZ  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,   r0   r'   r   r*   r*   r+   r#   f  s    zAssessmentsList.getc                 C   s   t | j|dS r   r   r   r*   r*   r+   __call__n  s    zAssessmentsList.__call__r-   c                 C   s   dS )r;   z#<Twilio.FlexApi.V1.AssessmentsList>r*   r1   r*   r*   r+   rK   v  s    zAssessmentsList.__repr__)!rL   rM   rN   r   r"   r
   rR   rP   rS   r   rT   r   rn   rp   r   intr   rv   r   ry   r   r{   r   rd   ru   rx   r   r   r,   r#   r   rK   rU   r*   r*   r(   r+   rf     s   
D
:

#

#

"

#




#




#rf   N)rO   typingr   r   r   r   r   r   r   Ztwilio.baser	   r
   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,   rd   rf   r*   r*   r*   r+   <module>   s   $xh