o
    f>h[4                     @   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 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)InstanceResource)ListResource)Version)Pagec                       s@   e Zd ZdZdedeeef f fddZdefddZ	  Z
S )	InsightsConversationsInstancez
    :ivar account_id: The id of the account.
    :ivar conversation_id: The unique id of the conversation
    :ivar segment_count: The count of segments for a conversation
    :ivar segments: The Segments of a conversation
    versionpayloadc                    sF   t  | |d| _|d| _t|d| _|d| _d S )N
account_idconversation_idsegment_countsegments)	super__init__getr   r   r	   integerr   r   )selfr   r   	__class__ a/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v1/insights_conversations.pyr       s   z&InsightsConversationsInstance.__init__returnc                 C      dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z1<Twilio.FlexApi.V1.InsightsConversationsInstance>r   r   r   r   r   __repr__*   s   z&InsightsConversationsInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r#   __classcell__r   r   r   r   r      s    
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 )InsightsConversationsPager   r   c                 C   s   t | j|S )z{
        Build an instance of InsightsConversationsInstance

        :param payload: Payload response from the API
        )r   _version)r   r   r   r   r   get_instance6   s   z&InsightsConversationsPage.get_instancec                 C   r    )r!   z-<Twilio.FlexApi.V1.InsightsConversationsPage>r   r"   r   r   r   r#   >      z"InsightsConversationsPage.__repr__N)	r$   r%   r&   r   r(   r   r   r,   r#   r   r   r   r   r*   4   s    r*   c                       s4  e Zd Zdef 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fddZ  ZS )InsightsConversationsListr   c                    s   t  | d| _dS )zw
        Initialize the InsightsConversationsList

        :param version: Version that contains the resource

        z/Insights/ConversationsN)r   r   _uri)r   r   r   r   r   r   I   s   
z"InsightsConversationsList.__init__Nauthorization
segment_idlimit	page_sizer   c                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams InsightsConversationsInstance 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: Unique Id of the segment for which conversation details needs to be fetched
        :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
        r3   r0   r1   r3   r2   )r+   read_limitspagestreamr   r0   r1   r2   r3   limitsr6   r   r   r   r7   T   s   z InsightsConversationsList.streamc                    s<   | j ||}| j|||d dI dH }| j ||d S )a-  
        Asynchronously streams InsightsConversationsInstance 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: Unique Id of the segment for which conversation details needs to be fetched
        :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
        r3   r4   Nr2   )r+   r5   
page_asyncstream_asyncr8   r   r   r   r;   u   s   z&InsightsConversationsList.stream_asyncc                 C   s   t | j||||dS )a  
        Lists InsightsConversationsInstance 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: Unique Id of the segment for which conversation details needs to be fetched
        :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
        r0   r1   r2   r3   )listr7   r   r0   r1   r2   r3   r   r   r   r=      s   zInsightsConversationsList.listc                    s*   dd | j ||||dI dH 2 I dH S )a  
        Asynchronously lists InsightsConversationsInstance 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: Unique Id of the segment for which conversation details needs to be fetched
        :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   ).0recordr   r   r   
<listcomp>   s
    z8InsightsConversationsList.list_async.<locals>.<listcomp>r<   N)r;   r>   r   r   r   
list_async   s   
z$InsightsConversationsList.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 InsightsConversationsInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param segment_id: Unique Id of the segment for which conversation details needs to be fetched
        :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 InsightsConversationsInstance
        Authorization	SegmentId	PageTokenr   PageSize!application/x-www-form-urlencodedrF   zContent-Typeapplication/jsonAcceptGETmethoduriparamsheaders)r
   ofr+   r6   r/   r*   	r   r0   r1   rC   rD   r3   datarS   responser   r   r   r6      s$   

zInsightsConversationsList.pagec           	         sX   t |||||d}t |dd}d|d< | jjd| j||dI dH }t| j|S )	aI  
        Asynchronously retrieve a single page of InsightsConversationsInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param segment_id: Unique Id of the segment for which conversation details needs to be fetched
        :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 InsightsConversationsInstance
        rE   rJ   rK   rL   rM   rN   rO   N)r
   rT   r+   r:   r/   r*   rU   r   r   r   r:     s&   

z$InsightsConversationsList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of InsightsConversationsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InsightsConversationsInstance
        rN   )r+   domaintwiliorequestr*   r   rX   rW   r   r   r   get_page/  s   	z"InsightsConversationsList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of InsightsConversationsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InsightsConversationsInstance
        rN   N)r+   rY   rZ   request_asyncr*   r\   r   r   r   get_page_async;  s   	z(InsightsConversationsList.get_page_asyncc                 C   r    )r!   z-<Twilio.FlexApi.V1.InsightsConversationsList>r   r"   r   r   r   r#   G  r-   z"InsightsConversationsList.__repr__)r$   r%   r&   r   r   r
   unsetr   r(   objectr   intr   r   r7   r   r;   r   r=   rB   r*   r6   r:   r]   r_   r#   r)   r   r   r   r   r.   G   s    


#


#


"


#





.





,r.   N)r'   typingr   r   r   r   r   r   r   twilio.baser	   r
   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r*   r.   r   r   r   r   <module>   s    $