o
    f>h`                     @   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dedeeef dee f fddZ	e
dd
dZejfdedededeeef dd f
ddZejfdedededeeef dd f
ddZdef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|ph| 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__ V/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v1/assessments.pyr"   *   s$   

zAssessmentsInstance.__init__returnAssessmentsContextc                 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+   _proxyF   s   
zAssessmentsInstance._proxyr   r   r   authorizationc                 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   )r1   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)r1   update_asyncr6   r*   r*   r+   r8   m   s   z AssessmentsInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 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__      
zAssessmentsInstance.__repr__N)r,   r-   )__name__
__module____qualname____doc__r   r   strr   r   r"   propertyr1   r
   unsetfloatr   objectr5   r8   rK   __classcell__r*   r*   r(   r+   r      sJ    




r   c                       s   e Zd Zdedef fddZejfdededede	ee
f d	ef
d
dZejfdededede	ee
f d	ef
ddZd	efddZ  ZS )r-   r   r   c                    s.   t  | d|i| _djd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}Nr*   )r!   r"   r%   r?   _uri)r'   r   r   r(   r*   r+   r"      s   zAssessmentsContext.__init__r   r   r   r2   r,   c                 C   sx   t |||d}t i }|t ju st|tr|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
   ofrT   
isinstancerR   r/   r5   rX   r   r%   r'   r   r   r   r2   rf   rg   r   r*   r*   r+   r5      s*   


zAssessmentsContext.updatec                    s   t |||d}t i }|t ju st|tr|r||d< d|d< d|d< | jjd| j||dI d	H }t| j|| j	d
 dS )r7   rY   r]   r^   r_   r`   ra   rb   rc   Nr   r.   )
r
   rh   rT   ri   rR   r/   r8   rX   r   r%   rj   r*   r*   r+   r8      s,   


zAssessmentsContext.update_asyncc                 C   r9   )r:   r;   c                 s   r<   r=   r>   r@   r*   r*   r+   rD     rE   z.AssessmentsContext.__repr__.<locals>.<genexpr>z)<Twilio.FlexApi.V1.AssessmentsContext {}>rF   rI   r*   r*   r+   rK      rL   zAssessmentsContext.__repr__)rN   rO   rP   r   rR   r"   r
   rT   rU   r   rV   r   r5   r8   rK   rW   r*   r*   r(   r+   r-      s6    

2

-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 )AssessmentsPager   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_instancec                 C      dS )r:   z#<Twilio.FlexApi.V1.AssessmentsPage>r*   r0   r*   r*   r+   rK        zAssessmentsPage.__repr__N)	rN   rO   rP   r   rR   r   r   rl   rK   r*   r*   r*   r+   rk     s    rk   c                       s  e Zd Zdef fddZejfdededededed	ed
edededede	ee
f defddZejfdededededed	ed
edededede	ee
f defddZejejddfde	ee
f de	ee
f dee dee dee f
ddZejejddfde	ee
f de	ee
f dee dee dee f
ddZejejddfde	ee
f de	ee
f dee dee dee f
ddZejejddfde	ee
f de	ee
f dee dee dee f
ddZejejejejejfde	ee
f de	ee
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ejejfde	ee
f de	ee
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defd+d,Zd*edefd-d.Zdefd/d0Z  Z S )1AssessmentsListr   c                    s   t  | d| _dS )zm
        Initialize the AssessmentsList

        :param version: Version that contains the resource

        z'/Insights/QualityManagement/AssessmentsN)r!   r"   rX   )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
        
CategorySidCategoryName	SegmentIdAgentIdrZ   MetricId
MetricNamer[   r\   QuestionnaireSidr^   r]   r_   r_   r`   ra   rb   rc   )r
   rh   r/   createrX   r   r'   rp   rq   r   r   r   rr   rs   r   r   rt   r2   rf   rg   r   r*   r*   r+   r~   &  s0    
zAssessmentsList.createc                    sj   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
        ru   r^   r}   r_   r`   ra   rb   rc   N)r
   rh   r/   create_asyncrX   r   r   r*   r*   r+   r   e  s2    
zAssessmentsList.create_asyncNlimit	page_sizec                 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
        r   r2   r   r   r   )r/   read_limitspagestreamr'   r2   r   r   r   limitsr   r*   r*   r+   r     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
        r   r   Nr   )r/   r   
page_asyncstream_asyncr   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   r   r   )listr   r'   r2   r   r   r   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 rM   r*   )rA   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
page_tokenpage_numberc           	      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
        r]   rx   	PageTokenr   PageSizer^   r}   r`   ra   GETrd   re   paramsrg   )r
   rh   r/   r   rX   rk   	r'   r2   r   r   r   r   rf   rg   responser*   r*   r+   r   '  s$   

zAssessmentsList.pagec           	         sX   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   r^   r}   r`   ra   r   r   N)r
   rh   r/   r   rX   rk   r   r*   r*   r+   r   S  s&   

zAssessmentsList.page_async
target_urlc                 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requestrk   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   request_asyncrk   r   r*   r*   r+   get_page_async  s   	zAssessmentsList.get_page_asyncr   c                 C      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#        zAssessmentsList.getc                 C   r   r   r   r   r*   r*   r+   __call__  r   zAssessmentsList.__call__c                 C   rm   )r:   z#<Twilio.FlexApi.V1.AssessmentsList>r*   r0   r*   r*   r+   rK     rn   zAssessmentsList.__repr__)!rN   rO   rP   r   r"   r
   rT   rR   rU   r   rV   r   r~   r   r   intr   r   r   r   r   r   r   rk   r   r   r   r   r-   r#   r   rK   rW   r*   r*   r(   r+   ro     s6   	


K	


A


#


#


"


#





.





,ro   N)rQ   typingr   r   r   r   r   r   r   twilio.baser	   r
   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r-   rk   ro   r*   r*   r*   r+   <module>   s    $ww