o
    f>h\t                     @   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                       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eef defddZejfdeeef defddZejfdeeef dd fddZejfdeeef dd fddZejejejejfdedeeef deeef deeef deee ef dd fddZejejejejfdedeeef deeef deeef deee ef dd fddZdef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|p5| 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__ b/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v1/insights_questionnaires.pyr   #   s   

z'InsightsQuestionnairesInstance.__init__returnInsightsQuestionnairesContextc                 C   s&   | j du 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authorizationc                 C      | 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                       | 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_asyncr/   r"   r"   r#   r2   S      
z+InsightsQuestionnairesInstance.delete_asyncc                 C   r+   )
        Fetch the InsightsQuestionnairesInstance

        :param authorization: The Authorization HTTP request header

        :returns: The fetched InsightsQuestionnairesInstance
        r-   )r)   fetchr/   r"   r"   r#   r5   a   s   
z$InsightsQuestionnairesInstance.fetchc                    r0   )
        Asynchronous coroutine to fetch the InsightsQuestionnairesInstance

        :param authorization: The Authorization HTTP request header

        :returns: The fetched InsightsQuestionnairesInstance
        r-   N)r)   fetch_asyncr/   r"   r"   r#   r7   o   r3   z*InsightsQuestionnairesInstance.fetch_asyncr   r   r   question_sidsc                 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   $   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:InsightsQuestionnairesInstance.__repr__.<locals>.<genexpr>z5<Twilio.FlexApi.V1.InsightsQuestionnairesInstance {}>joinr   itemsrE   r   contextr"   r"   r#   __repr__      
z'InsightsQuestionnairesInstance.__repr__N)r$   r%   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr)   r
   unsetr   objectboolr.   r2   r5   r7   r   r;   r>   rQ   __classcell__r"   r"   r    r#   r      s    
 













r   c                       sd  e Zd Zdedef fddZejfdeee	f de
fddZejfdeee	f de
fd	d
Zejfdeee	f defddZejfdeee	f defddZejejejejfde
deee	f deee	f deee	f deee e	f defddZejejejejfde
deee	f deee	f deee	f de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 InsightsQuestionnairesContext

        :param version: Version that contains the resource
        :param questionnaire_sid: The SID of the questionnaire
        r   z>/Insights/QualityManagement/Questionnaires/{questionnaire_sid}Nr"   )r   r   r   rE   _uri)r   r   r   r    r"   r#   r      s   z&InsightsQuestionnairesContext.__init__r*   r$   c                 C   s,   t d|i}t i }| jjd| j|dS )r,   AuthorizationDELETEmethoduriheaders)r
   ofr'   r.   r^   r   r*   rd   r"   r"   r#   r.      s   
z$InsightsQuestionnairesContext.deletec                    s4   t d|i}t i }| jjd| j|dI dH S )r1   r_   r`   ra   N)r
   re   r'   r2   r^   rf   r"   r"   r#   r2      s   

z*InsightsQuestionnairesContext.delete_asyncc                 C   sL   t d|i}t i }d|d< | jjd| j||d}t| j|| jd dS )r4   r_   application/jsonAcceptGETrb   rc   paramsrd   r   r&   )r
   re   r'   r5   r^   r   r   r   r*   datard   r   r"   r"   r#   r5      s   

z#InsightsQuestionnairesContext.fetchc                    sT   t d|i}t i }d|d< | jjd| j||dI dH }t| j|| jd dS )	r6   r_   rg   rh   ri   rj   Nr   r&   )r
   re   r'   r7   r^   r   r   rl   r"   r"   r#   r7     s   

z)InsightsQuestionnairesContext.fetch_asyncr   r   r   r8   c           	   
   C   s   t t|||t|dd 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 )r9   c                 S      | S rS   r"   er"   r"   r#   <lambda>Q      z6InsightsQuestionnairesContext.update.<locals>.<lambda>ActiveNameDescriptionQuestionSidsr_   !application/x-www-form-urlencodedContent-Typerg   rh   POSTrb   rc   rm   rd   r   r&   )r
   re   r	   boolean_to_stringmaprZ   
isinstancerX   r'   r;   r^   r   r   	r   r   r*   r   r   r8   rm   rd   r   r"   r"   r#   r;   8  s0   


z$InsightsQuestionnairesContext.updatec           	   
      s   t t|||t|dd 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 )r=   c                 S   rn   rS   r"   ro   r"   r"   r#   rq     rr   z<InsightsQuestionnairesContext.update_async.<locals>.<lambda>rs   r_   rx   ry   rg   rh   rz   r{   Nr   r&   )r
   re   r	   r|   r}   rZ   r~   rX   r'   r>   r^   r   r   r   r"   r"   r#   r>   j  s2   


z*InsightsQuestionnairesContext.update_asyncc                 C   r?   )r@   rA   c                 s   rB   rC   rD   rF   r"   r"   r#   rJ     rK   z9InsightsQuestionnairesContext.__repr__.<locals>.<genexpr>z4<Twilio.FlexApi.V1.InsightsQuestionnairesContext {}>rL   rO   r"   r"   r#   rQ     rR   z&InsightsQuestionnairesContext.__repr__)rT   rU   rV   r   rX   r   r
   rZ   r   r[   r\   r.   r2   r   r5   r7   r   r;   r>   rQ   r]   r"   r"   r    r#   r%      sp     



 

"



5



2r%   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 )InsightsQuestionnairesPager   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_instancec                 C      dS )r@   z.<Twilio.FlexApi.V1.InsightsQuestionnairesPage>r"   r(   r"   r"   r#   rQ        z#InsightsQuestionnairesPage.__repr__N)	rT   rU   rV   r   rX   r   r   r   rQ   r"   r"   r"   r#   r     s    r   c                       s  e Zd Zdef fddZejejejejfdedeee	f deee	f dee
e	f deee e	f d	efd
dZejejejejfdedeee	f deee	f dee
e	f de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*d+Z  Z S ),InsightsQuestionnairesListr   c                    s   t  | d| _dS )zx
        Initialize the InsightsQuestionnairesList

        :param version: Version that contains the resource

        z*/Insights/QualityManagement/QuestionnairesN)r   r   r^   )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   rn   rS   r"   ro   r"   r"   r#   rq     rr   z3InsightsQuestionnairesList.create.<locals>.<lambda>ru   rv   rt   rw   rx   r_   ry   ry   rg   rh   rz   r{   )	r
   re   r	   r|   r}   r'   creater^   r   	r   r   r*   r   r   r8   rm   rd   r   r"   r"   r#   r     s$   
z!InsightsQuestionnairesList.createc           	   
      sp   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   rn   rS   r"   ro   r"   r"   r#   rq     rr   z9InsightsQuestionnairesList.create_async.<locals>.<lambda>r   rx   r   ry   rg   rh   rz   r{   N)	r
   re   r	   r|   r}   r'   create_asyncr^   r   r   r"   r"   r#   r     s&   
z'InsightsQuestionnairesList.create_asyncNinclude_inactivelimit	page_sizec                 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   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   A  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   b  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 rS   r"   )rG   recordr"   r"   r#   
<listcomp>  s
    z9InsightsQuestionnairesList.list_async.<locals>.<listcomp>r   N)r   r   r"   r"   r#   
list_async  s   
z%InsightsQuestionnairesList.list_async
page_tokenpage_numberc           	      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
        r_   IncludeInactive	PageTokenr   PageSizerx   r   rg   rh   ri   rj   )r
   re   r	   r|   r'   r   r^   r   	r   r*   r   r   r   r   rm   rd   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   rx   r   rg   rh   ri   rj   N)r
   re   r	   r|   r'   r   r^   r   r   r"   r"   r#   r     s&   

z%InsightsQuestionnairesList.page_async
target_urlc                 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
        ri   )r'   domaintwiliorequestr   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
        ri   N)r'   r   r   request_asyncr   r   r"   r"   r#   get_page_async  s   	z)InsightsQuestionnairesList.get_page_asyncr   c                 C      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        zInsightsQuestionnairesList.getc                 C   r   r   r   r   r"   r"   r#   __call__  r   z#InsightsQuestionnairesList.__call__c                 C   r   )r@   z.<Twilio.FlexApi.V1.InsightsQuestionnairesList>r"   r(   r"   r"   r#   rQ   '  r   z#InsightsQuestionnairesList.__repr__)!rT   rU   rV   r   r   r
   rZ   rX   r   r[   r\   r   r   r   r   r   intr   r   r   r   r   r   r   r   r   r   r   r%   r   r   rQ   r]   r"   r"   r    r#   r     s   



0



/


#


#


"


#





.





,

r   N)rW   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%   r   r   r"   r"   r"   r#   <module>   s    $ & j