U
    ^g%it                     @   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)	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       sl  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f ed
ddZejfeeef ed
ddZejfeeef d d
ddZejfeeef d d
ddZejejejejfeeeef eeef eeef eee ef d dddZejejejejfeeeef eeef eeef eee ef d dddZedddZ  ZS )InsightsQuestionnairesInstancea  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource.
    :ivar questionnaire_sid: The sid of this questionnaire
    :ivar name: The name of this category.
    :ivar description: The description of this questionnaire
    :ivar active: The flag to enable or disable questionnaire
    :ivar questions: The list of questions with category for a questionnaire
    :ivar url:
    N)versionpayloadquestionnaire_sidc                    sz   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	d|pj| ji| _
d | _d S )Naccount_sidr   namedescriptionactive	questionsurl)super__init__getr   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__ n/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/flex_api/v1/insights_questionnaires.pyr   #   s     z'InsightsQuestionnairesInstance.__init__InsightsQuestionnairesContextreturnc                 C   s&   | j dkr t| j| jd d| _ | j S )a  
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: InsightsQuestionnairesContext for this InsightsQuestionnairesInstance
        Nr   r   )r   r$   _versionr   r   r"   r"   r#   _proxy8   s    
z%InsightsQuestionnairesInstance._proxyauthorizationr&   c                 C   s   | j j|dS )
        Deletes the InsightsQuestionnairesInstance

        :param authorization: The Authorization HTTP request header

        :returns: True if delete succeeds, False otherwise
        r,   )r*   deleter   r,   r"   r"   r#   r/   G   s    z%InsightsQuestionnairesInstance.deletec                    s   | j j|dI dH S )
        Asynchronous coroutine that deletes the InsightsQuestionnairesInstance

        :param authorization: The Authorization HTTP request header

        :returns: True if delete succeeds, False otherwise
        r.   N)r*   delete_asyncr0   r"   r"   r#   r2   S   s    
z+InsightsQuestionnairesInstance.delete_asyncc                 C   s   | j j|dS )
        Fetch the InsightsQuestionnairesInstance

        :param authorization: The Authorization HTTP request header

        :returns: The fetched InsightsQuestionnairesInstance
        r.   )r*   fetchr0   r"   r"   r#   r4   a   s    
z$InsightsQuestionnairesInstance.fetchc                    s   | j j|dI dH S )
        Asynchronous coroutine to fetch the InsightsQuestionnairesInstance

        :param authorization: The Authorization HTTP request header

        :returns: The fetched InsightsQuestionnairesInstance
        r.   N)r*   fetch_asyncr0   r"   r"   r#   r6   o   s    
z*InsightsQuestionnairesInstance.fetch_asyncr   r,   r   r   question_sidsr&   c                 C   s   | j j|||||dS )  
        Update the InsightsQuestionnairesInstance

        :param active: The flag to enable or disable questionnaire
        :param authorization: The Authorization HTTP request header
        :param name: The name of this questionnaire
        :param description: The description of this questionnaire
        :param question_sids: The list of questions sids under a questionnaire

        :returns: The updated InsightsQuestionnairesInstance
        r   r,   r   r   r8   )r*   updater   r   r,   r   r   r8   r"   r"   r#   r;   }   s    z%InsightsQuestionnairesInstance.updatec                    s   | j j|||||dI dH S )  
        Asynchronous coroutine to update the InsightsQuestionnairesInstance

        :param active: The flag to enable or disable questionnaire
        :param authorization: The Authorization HTTP request header
        :param name: The name of this questionnaire
        :param description: The description of this questionnaire
        :param question_sids: The list of questions sids under a questionnaire

        :returns: The updated InsightsQuestionnairesInstance
        r:   N)r*   update_asyncr<   r"   r"   r#   r>      s    z+InsightsQuestionnairesInstance.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:InsightsQuestionnairesInstance.__repr__.<locals>.<genexpr>z5<Twilio.FlexApi.V1.InsightsQuestionnairesInstance {}>joinr   itemsrC   r   contextr"   r"   r#   __repr__   s    z'InsightsQuestionnairesInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr*   r
   unsetr   objectboolr/   r2   r4   r6   r   r;   r>   rN   __classcell__r"   r"   r    r#   r      sd    









r   c                       sF  e Zd Zeed fddZejfeee	f e
dddZejfeee	f e
dddZejfeee	f edd	d
Zejfeee	f edddZejejejejfe
eee	f eee	f eee	f eee e	f edddZejejejejfe
eee	f eee	f eee	f 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 InsightsQuestionnairesContext

        :param version: Version that contains the resource
        :param questionnaire_sid: The SID of the questionnaire
        r   z>/Insights/QualityManagement/Questionnaires/{questionnaire_sid}N)r   r   r   rC   _uri)r   r   r   r    r"   r#   r      s     z&InsightsQuestionnairesContext.__init__r+   c                 C   s,   t d|i}t i }| jjd| j|dS )r-   AuthorizationDELETEmethoduriheaders)r
   ofr(   r/   rY   r   r,   r_   r"   r"   r#   r/      s     
z$InsightsQuestionnairesContext.deletec                    s2   t d|i}t i }| jjd| j|dI dH S )r1   rZ   r[   r\   N)r
   r`   r(   r2   rY   ra   r"   r"   r#   r2      s    
 
  z*InsightsQuestionnairesContext.delete_asyncc                 C   s\   t i }|t jks*t|tr"|r*||d< d|d< | jjd| j|d}t| j|| j	d dS )r3   rZ   application/jsonAcceptGETr\   r   r'   )
r
   r`   rU   
isinstancerS   r(   r4   rY   r   r   r   r,   r_   r   r"   r"   r#   r4      s    
z#InsightsQuestionnairesContext.fetchc                    sb   t i }|t jks*t|tr"|r*||d< d|d< | jjd| j|dI dH }t| j|| j	d dS )	r5   rZ   rb   rc   rd   r\   Nr   r'   )
r
   r`   rU   re   rS   r(   r6   rY   r   r   rf   r"   r"   r#   r6     s&    
  z)InsightsQuestionnairesContext.fetch_asyncr7   c           	   
   C   s   t t|||t|dd d}t i }|t jksPt|trH|rP||d< d|d< d|d< | jj	d	| j
||d
}t| j|| jd dS )r9   c                 S   s   | S Nr"   er"   r"   r#   <lambda>O      z6InsightsQuestionnairesContext.update.<locals>.<lambda>ActiveNameDescriptionQuestionSidsrZ   !application/x-www-form-urlencodedContent-Typerb   rc   POSTr]   r^   datar_   r   r'   )r
   r`   r	   boolean_to_stringmaprU   re   rS   r(   r;   rY   r   r   	r   r   r,   r   r   r8   ru   r_   r   r"   r"   r#   r;   6  s8    
   z$InsightsQuestionnairesContext.updatec           	   
      s   t t|||t|dd d}t i }|t jksPt|trH|rP||d< d|d< d|d< | jj	d	| j
||d
I dH }t| j|| jd dS )r=   c                 S   s   | S rg   r"   rh   r"   r"   r#   rj     rk   z<InsightsQuestionnairesContext.update_async.<locals>.<lambda>rl   rZ   rq   rr   rb   rc   rs   rt   Nr   r'   )r
   r`   r	   rv   rw   rU   re   rS   r(   r>   rY   r   r   rx   r"   r"   r#   r>   h  s8    
   z*InsightsQuestionnairesContext.update_asyncr%   c                 C   s$   d dd | j D }d|S )r?   r@   c                 s   s   | ]\}}d  ||V  qdS rA   rB   rD   r"   r"   r#   rH     s     z9InsightsQuestionnairesContext.__repr__.<locals>.<genexpr>z4<Twilio.FlexApi.V1.InsightsQuestionnairesContext {}>rI   rL   r"   r"   r#   rN     s    z&InsightsQuestionnairesContext.__repr__)rO   rP   rQ   r   rS   r   r
   rU   r   rV   rW   r/   r2   r   r4   r6   r   r;   r>   rN   rX   r"   r"   r    r#   r$      sT   


"


5


2r$   c                   @   s2   e Zd Zeeef edddZedddZdS )InsightsQuestionnairesPage)r   r&   c                 C   s   t | j|S )z|
        Build an instance of InsightsQuestionnairesInstance

        :param payload: Payload response from the API
        )r   r(   )r   r   r"   r"   r#   get_instance  s    z'InsightsQuestionnairesPage.get_instancer%   c                 C   s   dS )r?   z.<Twilio.FlexApi.V1.InsightsQuestionnairesPage>r"   r)   r"   r"   r#   rN     s    z#InsightsQuestionnairesPage.__repr__N)	rO   rP   rQ   r   rS   r   r   rz   rN   r"   r"   r"   r#   ry     s   ry   c                       s  e Zd Zed fddZejejejejfeeee	f eee	f ee
e	f eee e	f edddZejejejejfeeee	f eee	f ee
e	f 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 )%InsightsQuestionnairesList)r   c                    s   t  | d| _dS )zx
        Initialize the InsightsQuestionnairesList

        :param version: Version that contains the resource

        z*/Insights/QualityManagement/QuestionnairesN)r   r   rY   )r   r   r    r"   r#   r     s    z#InsightsQuestionnairesList.__init__)r   r,   r   r   r8   r&   c           	   
   C   sh   t ||t|t|dd d}t |dd}d|d< d|d< | jjd	| j||d
}t| j|S )a  
        Create the InsightsQuestionnairesInstance

        :param name: The name of this questionnaire
        :param authorization: The Authorization HTTP request header
        :param description: The description of this questionnaire
        :param active: The flag to enable or disable questionnaire
        :param question_sids: The list of questions sids under a questionnaire

        :returns: The created InsightsQuestionnairesInstance
        c                 S   s   | S rg   r"   rh   r"   r"   r#   rj     rk   z3InsightsQuestionnairesList.create.<locals>.<lambda>rn   ro   rm   rp   rq   rZ   rr   rr   rb   rc   rs   rt   )	r
   r`   r	   rv   rw   r(   createrY   r   	r   r   r,   r   r   r8   ru   r_   r   r"   r"   r#   r~     s*       z!InsightsQuestionnairesList.createc           	   
      sn   t ||t|t|dd d}t |dd}d|d< d|d< | jjd	| j||d
I dH }t| j|S )a  
        Asynchronously create the InsightsQuestionnairesInstance

        :param name: The name of this questionnaire
        :param authorization: The Authorization HTTP request header
        :param description: The description of this questionnaire
        :param active: The flag to enable or disable questionnaire
        :param question_sids: The list of questions sids under a questionnaire

        :returns: The created InsightsQuestionnairesInstance
        c                 S   s   | S rg   r"   rh   r"   r"   r#   rj   
  rk   z9InsightsQuestionnairesList.create_async.<locals>.<lambda>r|   rq   r}   rr   rb   rc   rs   rt   N)	r
   r`   r	   rv   rw   r(   create_asyncrY   r   r   r"   r"   r#   r     s*       z'InsightsQuestionnairesList.create_asyncN)r,   include_inactivelimit	page_sizer&   c                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams InsightsQuestionnairesInstance 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 bool include_inactive: Flag indicating whether to include inactive questionnaires or not
        :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,   r   r   r   )r(   read_limitspagestreamr   r,   r   r   r   Zlimitsr   r"   r"   r#   r     s    z!InsightsQuestionnairesList.streamc                    s:   | j ||}| j|||d dI dH }| j ||d S )a+  
        Asynchronously streams InsightsQuestionnairesInstance 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 bool include_inactive: Flag indicating whether to include inactive questionnaires or not
        :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'InsightsQuestionnairesList.stream_asyncc                 C   s   t | j||||dS )a  
        Lists InsightsQuestionnairesInstance 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 bool include_inactive: Flag indicating whether to include inactive questionnaires or not
        :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,   r   r   r   )listr   r   r,   r   r   r   r"   r"   r#   r   `  s    zInsightsQuestionnairesList.listc                    s(   dd | j ||||dI dH 2 I dH S )a  
        Asynchronously lists InsightsQuestionnairesInstance 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 bool include_inactive: Flag indicating whether to include inactive questionnaires or not
        :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 rg   r"   )rE   recordr"   r"   r#   
<listcomp>  s   z9InsightsQuestionnairesList.list_async.<locals>.<listcomp>r   N)r   r   r"   r"   r#   
list_async  s    
z%InsightsQuestionnairesList.list_async)r,   r   
page_tokenpage_numberr   r&   c           	      C   sV   t |t||||d}t |dd}d|d< | jjd| j||d}t| j|S )a8  
        Retrieve a single page of InsightsQuestionnairesInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param include_inactive: Flag indicating whether to include inactive questionnaires or not
        :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 InsightsQuestionnairesInstance
        rZ   ZIncludeInactiveZ	PageTokenr   ZPageSizerq   r}   rb   rc   rd   r]   r^   paramsr_   )r
   r`   r	   rv   r(   r   rY   ry   	r   r,   r   r   r   r   ru   r_   responser"   r"   r#   r     s*    
   zInsightsQuestionnairesList.pagec           	         s\   t |t||||d}t |dd}d|d< | jjd| j||dI dH }t| j|S )	aG  
        Asynchronously retrieve a single page of InsightsQuestionnairesInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param include_inactive: Flag indicating whether to include inactive questionnaires or not
        :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 InsightsQuestionnairesInstance
        r   rq   r}   rb   rc   rd   r   N)r
   r`   r	   rv   r(   r   rY   ry   r   r"   r"   r#   r     s*    
   z%InsightsQuestionnairesList.page_async)
target_urlr&   c                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of InsightsQuestionnairesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InsightsQuestionnairesInstance
        rd   )r(   domaintwiliorequestry   r   r   r   r"   r"   r#   get_page  s    	z#InsightsQuestionnairesList.get_pagec                    s$   | j jjd|I dH }t| j |S )a   
        Asynchronously retrieve a specific page of InsightsQuestionnairesInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InsightsQuestionnairesInstance
        rd   N)r(   r   r   Zrequest_asyncry   r   r"   r"   r#   get_page_async  s    	z)InsightsQuestionnairesList.get_page_async)r   r&   c                 C   s   t | j|dS z|
        Constructs a InsightsQuestionnairesContext

        :param questionnaire_sid: The SID of the questionnaire
        r'   r$   r(   r   r   r"   r"   r#   r     s     zInsightsQuestionnairesList.getc                 C   s   t | j|dS r   r   r   r"   r"   r#   __call__  s     z#InsightsQuestionnairesList.__call__r%   c                 C   s   dS )r?   z.<Twilio.FlexApi.V1.InsightsQuestionnairesList>r"   r)   r"   r"   r#   rN   %  s    z#InsightsQuestionnairesList.__repr__)!rO   rP   rQ   r   r   r
   rU   rS   r   rV   rW   r   r   r~   r   r   intr   r   r   r   r   r   ry   r   r   r   r   r$   r   r   rN   rX   r"   r"   r    r#   r{     s   


0


/

#

#

"

#




.




,

r{   N)rR   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$   ry   r{   r"   r"   r"   r#   <module>   s   $ & h