
    pi`                         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
e      Z G d de      Z G d de      Z G d de      Zy)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                        e Zd ZdZ	 ddedeeef   dee   f fdZ	e
dd       Zej                  fded	ed
edeeef   dd f
dZej                  fded	ed
edeeef   dd f
dZdefdZ x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:
    versionpayloadassessment_sidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        d|xs | j                  i| _        d | _        y )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__s       e/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/flex_api/v1/assessments.pyr$   zAssessmentsInstance.__init__*   s    	!*1++m*D-4[[9I-J%,[[%:&-kk(&;%,[[%:'.{{:'>)0\)B(/K(@)0\)B*1++m*D(/K(@7>{{<7P(/K(@")++e"4 nC0C0C
 7;    returnc                     | j                   )t        | j                  | j                  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
        r   r   )r'   AssessmentsContext_versionr&   r(   s    r*   _proxyzAssessmentsInstance._proxyF   s:     == .#~~.>?DM }}r+   r   r   r   authorizationc                 @    | j                   j                  ||||      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   r3   )r2   updater(   r   r   r   r3   s        r*   r7   zAssessmentsInstance.updateU   s,    " {{!!#'	 " 
 	
r+   c                 \   K   | j                   j                  ||||       d{   S 7 w)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   s        r*   r;   z AssessmentsInstance.update_asyncm   s:     " [[--#'	 . 
 
 	
 
s   #,*,c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r*   	<genexpr>z/AssessmentsInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z*<Twilio.FlexApi.V1.AssessmentsInstance {}>joinr&   itemsrB   r(   contexts     r*   __repr__zAssessmentsInstance.__repr__   s6     ((SDNN<P<P<RSS;BB7KKr+   )N)r,   r/   )__name__
__module____qualname____doc__r   r   strr   r   r$   propertyr2   r
   unsetfloatr   objectr7   r;   rO   __classcell__r)   s   @r*   r   r      s    * )-	;; c3h; !	;8  & -3LL

 
 	

 S&[)
 

: -3LL

 
 	

 S&[)
 

0L# Lr+   r   c                        e Zd Zdedef fdZej                  fdededede	ee
f   def
d	Zej                  fdededede	ee
f   def
d
ZdefdZ xZS )r/   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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&   rB   _uri)r(   r   r   r)   s      r*   r$   zAssessmentsContext.__init__   sF     	! n
 VNUU 
nn
	r+   r   r   r   r3   r,   c                 `   t        j                  |||d      }t        j                  i       }|t         j                  u st        |t              r|r||d<   d|d<   d|d<   | j
                  j                  d| j                  ||      }t        | j
                  || j                  d	   
      S )r5   Offset
AnswerTextAnswerIdAuthorization!application/x-www-form-urlencodedContent-Typeapplication/jsonAcceptPOSTmethoduridataheadersr   r.   )
r
   ofrV   
isinstancerT   r0   r7   r^   r   r&   r(   r   r   r   r3   rm   rn   r   s           r*   r7   zAssessmentsContext.update   s    $ yy )%
 ))B- V\\)=#.}'4GO$"E.--&&tyytW ' 
 #MM74>>BR3S
 	
r+   c                 |  K   t        j                  |||d      }t        j                  i       }|t         j                  u st        |t              r|r||d<   d|d<   d|d<   | j
                  j                  d| j                  ||       d	{   }t        | j
                  || j                  d
         S 7 )w)r:   r`   rd   re   rf   rg   rh   ri   rj   Nr   r.   )
r
   ro   rV   rp   rT   r0   r;   r^   r   r&   rq   s           r*   r;   zAssessmentsContext.update_async   s     $ yy )%
 ))B- V\\)=#.}'4GO$"E.22tyytW 3 
 
 #MM74>>BR3S
 	
	
s   BB<B:*B<c                     dj                  d | j                  j                         D              }dj                  |      S )r=   r>   c              3   F   K   | ]  \  }}d j                  ||        ywr@   rA   rC   s      r*   rG   z.AssessmentsContext.__repr__.<locals>.<genexpr>  rH   rI   z)<Twilio.FlexApi.V1.AssessmentsContext {}>rJ   rM   s     r*   rO   zAssessmentsContext.__repr__   s6     ((SDNN<P<P<RSS:AA'JJr+   )rP   rQ   rR   r   rT   r$   r
   rV   rW   r   rX   r   r7   r;   rO   rY   rZ   s   @r*   r/   r/      s    
 
 
, -3LL+
+
 +
 	+

 S&[)+
 
+
d -3LL+
+
 +
 	+

 S&[)+
 
+
ZK# Kr+   r/   c                   2    e Zd Zdeeef   defdZdefdZy)AssessmentsPager   r,   c                 .    t        | j                  |      S )zq
        Build an instance of AssessmentsInstance

        :param payload: Payload response from the API
        )r   r0   )r(   r   s     r*   get_instancezAssessmentsPage.get_instance  s     #4=='::r+   c                      y)r=   z#<Twilio.FlexApi.V1.AssessmentsPage>r]   r1   s    r*   rO   zAssessmentsPage.__repr__       5r+   N)	rP   rQ   rR   r   rT   r   r   rx   rO   r]   r+   r*   rv   rv     s*    ;DcN ;7J ;5# 5r+   rv   c                   x    e Zd Zdef f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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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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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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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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ZdedefdZdedefdZdedefd Zdedefd!Zdefd"Z xZ S )#AssessmentsListr   c                 2    t         |   |       d| _        y)zm
        Initialize the AssessmentsList

        :param version: Version that contains the resource

        z'/Insights/QualityManagement/AssessmentsN)r#   r$   r^   )r(   r   r)   s     r*   r$   zAssessmentsList.__init__  s     	!=	r+   category_sidcategory_namer   r   r   	metric_idmetric_namer   r   questionnaire_sidr3   r,   c                    t        j                  |||||||||	|
d
      }t        j                  |dd      }d|d<   d|d<   | j                  j                  d| j                  ||      }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AgentIdra   MetricId
MetricNamerb   rc   QuestionnaireSidre   rd   rf   rf   rg   rh   ri   rj   )r
   ro   r0   creater^   r   r(   r~   r   r   r   r   r   r   r   r   r   r3   rm   rn   r   s                  r*   r   zAssessmentsList.create&  s    @ yy+ -'# %))%$5
 ))!. C
 #F.--&&tyytW ' 
 #4=='::r+   c                    K   t        j                  |||||||||	|
d
      }t        j                  |dd      }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  |      S 7 w)
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
        r   re   r   rf   rg   rh   ri   rj   N)r
   ro   r0   create_asyncr^   r   r   s                  r*   r   zAssessmentsList.create_asynce  s     @ yy+ -'# %))%$5
 ))!. C
 #F.22tyytW 3 
 
 #4=='::	
s   A/B1B2BNlimit	page_sizec                     | j                   j                  ||      }| j                  |||d         }| j                   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   r3   r   r   r   )r0   read_limitspagestreamr(   r3   r   r   r   limitsr   s          r*   r   zAssessmentsList.stream  sX    0 **5)<yy'![)  
 }}##D&/::r+   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)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   )r0   r   
page_asyncstream_asyncr   s          r*   r   zAssessmentsList.stream_async  sf     0 **5)<__'![) % 
 
 }}))$w@@
s   7AA$Ac                 >    t        | j                  ||||            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
        r3   r   r   r   )listr   )r(   r3   r   r   r   s        r*   r   zAssessmentsList.list  s.    . KK+%#	  
 	
r+   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )r(   r3   r   r   r   records         r*   
list_asynczAssessmentsList.list_async  sZ     2 '+&7&7+%#	 '8 ' !
 
 !
 
 	
 
s0   =0=842
48=48=
page_tokenpage_numberc                     t        j                  |||||d      }t        j                  |dd      }d|d<   | j                  j                  d| j                  ||      }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
        rd   r   	PageTokenr   PageSizere   r   rg   rh   GETrk   rl   paramsrn   )r
   ro   r0   r   r^   rv   	r(   r3   r   r   r   r   rm   rn   responses	            r*   r   zAssessmentsList.page'  s    ( yy!.''#%
 ))!. C
 /==%%diig & 
 t}}h77r+   c                   K   t        j                  |||||d      }t        j                  |dd      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	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   re   r   rg   rh   r   r   N)r
   ro   r0   r   r^   rv   r   s	            r*   r   zAssessmentsList.page_asyncS  s     ( yy!.''#%
 ))!. C
 /11diig 2 
 
 t}}h77
s   A%B'B(B
target_urlc                     | j                   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requestrv   r(   r   r   s      r*   get_pagezAssessmentsList.get_page  s7     ==''..66ujIt}}h77r+   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)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   request_asyncrv   r   s      r*   get_page_asynczAssessmentsList.get_page_async  sD      --44BB5*UUt}}h77 Vs   4AAAr   c                 0    t        | j                  |      S zz
        Constructs a AssessmentsContext

        :param assessment_sid: The SID of the assessment to be modified
        r.   r/   r0   r(   r   s     r*   r%   zAssessmentsList.get       "$--OOr+   c                 0    t        | j                  |      S r   r   r   s     r*   __call__zAssessmentsList.__call__  r   r+   c                      y)r=   z#<Twilio.FlexApi.V1.AssessmentsList>r]   r1   s    r*   rO   zAssessmentsList.__repr__  rz   r+   )!rP   rQ   rR   r   r$   r
   rV   rT   rW   r   rX   r   r   r   r   intr   r   r	   r   r   r   r   rv   r   r   r   r   r/   r%   r   rO   rY   rZ   s   @r*   r|   r|     se   	> 	>. -3LL=;=; =; 	=;
 =; =; =; =; =; =; =; S&[)=; 
=;V -3LL=;=; =; 	=;
 =; =; =; =; =; =; =; S&[)=; 
=;B -3LL)/##';S&[); #v+&; }	;
 C=; 
%	&;F -3LL)/##'AS&[)A #v+&A }	A
 C=A 
*	+AF -3LL)/##'
S&[)
 #v+&
 }	

 C=
 
!	"
D -3LL)/##'
S&[)
 #v+&
 }	

 C=
 
!	"
F -3LL)/)/*0,,(.*8S&[)*8 #v+&*8 #v+&	*8
 3;'*8 f%*8 
*8\ -3LL)/)/*0,,(.*8S&[)*8 #v+&*8 #v+&	*8
 3;'*8 f%*8 
*8X
83 
8? 
8
8s 
8 
8P# P*< PPs P/A P5# 5r+   r|   N)rS   typingr   r   r   r   r   r   r	   twilio.baser
   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r/   rv   r|   r]   r+   r*   <module>r      se    M L L  8 : 2 ' !tL* tLntK tKn5d 5&T5l T5r+   