U
    ^g%i[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eeeef d fddZed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__ m/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/flex_api/v1/insights_conversations.pyr       s    z&InsightsConversationsInstance.__init__returnc                 C   s   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                   @   s2   e Zd Zeeef edddZedddZdS )InsightsConversationsPage)r   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_instancer   c                 C   s   dS )r!   z-<Twilio.FlexApi.V1.InsightsConversationsPage>r   r"   r   r   r   r#   >   s    z"InsightsConversationsPage.__repr__N)	r$   r%   r&   r   r(   r   r   r,   r#   r   r   r   r   r*   4   s   r*   c                       s  e Zd Zed f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dddZ  ZS )InsightsConversationsList)r   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
        r2   r/   r0   r2   r1   )r+   read_limitspagestreamr   r/   r0   r1   r2   Zlimitsr5   r   r   r   r6   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
        r2   r3   Nr1   )r+   r4   
page_asyncstream_asyncr7   r   r   r   r9   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
        r/   r0   r1   r2   )listr6   r   r/   r0   r1   r2   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)r9   r<   r   r   r   
list_async   s    
z$InsightsConversationsList.list_async)r/   r0   
page_tokenpage_numberr2   r    c           	      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
        AuthorizationZ	SegmentIdZ	PageTokenr   ZPageSize!application/x-www-form-urlencodedrD   zContent-Typeapplication/jsonAcceptGETmethoduriparamsheaders)r
   ofr+   r5   r.   r*   	r   r/   r0   rA   rB   r2   datarN   responser   r   r   r5      s*    
   zInsightsConversationsList.pagec           	         sV   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
        rC   rE   rF   rG   rH   rI   rJ   N)r
   rO   r+   r8   r.   r*   rP   r   r   r   r8     s*    
   z$InsightsConversationsList.page_async)
target_urlr    c                 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
        rI   )r+   domaintwiliorequestr*   r   rS   rR   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
        rI   N)r+   rT   rU   Zrequest_asyncr*   rW   r   r   r   get_page_async;  s    	z(InsightsConversationsList.get_page_asyncr   c                 C   s   dS )r!   z-<Twilio.FlexApi.V1.InsightsConversationsList>r   r"   r   r   r   r#   G  s    z"InsightsConversationsList.__repr__)r$   r%   r&   r   r   r
   unsetr   r(   objectr   intr   r   r6   r   r9   r   r;   r@   r*   r5   r8   rX   rY   r#   r)   r   r   r   r   r-   G   s   

#

#

"

#




.




,r-   N)r'   typingr   r   r   r   r   r   r   Ztwilio.baser	   r
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r*   r-   r   r   r   r   <module>   s   $