o
    f>hR@                     @   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)	serialize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 )	InsightsSegmentsInstancea  
    :ivar segment_id: To unique id of the segment
    :ivar external_id: The unique id for the conversation.
    :ivar queue:
    :ivar external_contact:
    :ivar external_segment_link_id: The uuid for the external_segment_link.
    :ivar date: The date of the conversation.
    :ivar account_id: The unique id for the account.
    :ivar external_segment_link: The hyperlink to recording of the task event.
    :ivar agent_id: The unique id for the agent.
    :ivar agent_phone: The phone number of the agent.
    :ivar agent_name: The name of the agent.
    :ivar agent_team_name: The team name to which agent belongs.
    :ivar agent_team_name_in_hierarchy: he team name to which agent belongs.
    :ivar agent_link: The link to the agent conversation.
    :ivar customer_phone: The phone number of the customer.
    :ivar customer_name: The name of the customer.
    :ivar customer_link: The link to the customer conversation.
    :ivar segment_recording_offset: The offset value for the recording.
    :ivar media: The media identifiers of the conversation.
    :ivar assessment_type: The type of the assessment.
    :ivar assessment_percentage: The percentage scored on the Assessments.
    :ivar url:
    versionpayloadc                    s  t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _|d| _d S )N
segment_idexternal_idqueueexternal_contactexternal_segment_link_iddate
account_idexternal_segment_linkagent_idagent_phone
agent_nameagent_team_nameagent_team_name_in_hierarchy
agent_linkcustomer_phonecustomer_namecustomer_linksegment_recording_offsetmediaassessment_typeassessment_percentageurl)super__init__getr   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   )selfr   r   	__class__ \/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v1/insights_segments.pyr)   2   sB   z!InsightsSegmentsInstance.__init__returnc                 C      dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z,<Twilio.FlexApi.V1.InsightsSegmentsInstance>r.   r+   r.   r.   r/   __repr__V   s   z!InsightsSegmentsInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r)   r4   __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 )InsightsSegmentsPager   r0   c                 C   s   t | j|S )zv
        Build an instance of InsightsSegmentsInstance

        :param payload: Payload response from the API
        )r   _version)r+   r   r.   r.   r/   get_instanceb   s   z!InsightsSegmentsPage.get_instancec                 C   r1   )r2   z(<Twilio.FlexApi.V1.InsightsSegmentsPage>r.   r3   r.   r.   r/   r4   j      zInsightsSegmentsPage.__repr__N)	r5   r6   r7   r   r9   r   r   r=   r4   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ddfdeee	f deee	f dee
e e	f dee d	ee d
ee fddZejejejddfdeee	f deee	f dee
e e	f dee d	ee d
ee fddZejejejddfdeee	f deee	f dee
e e	f dee d	ee d
e
e fddZejejejddfdeee	f deee	f de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ejfdeee	f deee	f de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ejfdeee	f deee	f de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 ) InsightsSegmentsListr   c                    s   t  | d| _dS )zr
        Initialize the InsightsSegmentsList

        :param version: Version that contains the resource

        z/Insights/SegmentsN)r(   r)   _uri)r+   r   r,   r.   r/   r)   u   s   
zInsightsSegmentsList.__init__Nauthorizationr   reservation_idlimit	page_sizer0   c                 C   s6   | j ||}| j||||d d}| j ||d S )a.  
        Streams InsightsSegmentsInstance 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: To unique id of the segment
        :param List[str] reservation_id: The list of reservation Ids
        :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
        rD   rA   r   rB   rD   rC   )r<   read_limitspagestreamr+   rA   r   rB   rC   rD   limitsrG   r.   r.   r/   rH      s   zInsightsSegmentsList.streamc                    s>   | j ||}| j||||d dI dH }| j ||d S )a=  
        Asynchronously streams InsightsSegmentsInstance 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: To unique id of the segment
        :param List[str] reservation_id: The list of reservation Ids
        :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
        rD   rE   NrC   )r<   rF   
page_asyncstream_asyncrI   r.   r.   r/   rL      s   z!InsightsSegmentsList.stream_asyncc                 C   s   t | j|||||dS )a  
        Lists InsightsSegmentsInstance 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: To unique id of the segment
        :param List[str] reservation_id: The list of reservation Ids
        :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
        rA   r   rB   rC   rD   )listrH   r+   rA   r   rB   rC   rD   r.   r.   r/   rN      s   zInsightsSegmentsList.listc                    s,   dd | j |||||dI dH 2 I dH S )a  
        Asynchronously lists InsightsSegmentsInstance 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: To unique id of the segment
        :param List[str] reservation_id: The list of reservation Ids
        :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
    z3InsightsSegmentsList.list_async.<locals>.<listcomp>rM   N)rL   rO   r.   r.   r/   
list_async   s   
zInsightsSegmentsList.list_async
page_tokenpage_numberc           
   	   C   s^   t ||t|dd |||d}t |dd}d|d< | jjd| j||d	}	t| j|	S )
a;  
        Retrieve a single page of InsightsSegmentsInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param segment_id: To unique id of the segment
        :param reservation_id: The list of reservation Ids
        :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 InsightsSegmentsInstance
        c                 S      | S rP   r.   er.   r.   r/   <lambda>)      z+InsightsSegmentsList.page.<locals>.<lambda>Authorization	SegmentIdReservationId	PageTokenr   PageSize!application/x-www-form-urlencodedr]   zContent-Typeapplication/jsonAcceptGETmethoduriparamsheaders)r
   ofr	   mapr<   rG   r@   r;   
r+   rA   r   rB   rU   rV   rD   datark   responser.   r.   r/   rG     s&   
zInsightsSegmentsList.pagec           
   	      sf   t ||t|dd |||d}t |dd}d|d< | jjd| j||d	I d
H }	t| j|	S )aJ  
        Asynchronously retrieve a single page of InsightsSegmentsInstance records from the API.
        Request is executed immediately

        :param authorization: The Authorization HTTP request header
        :param segment_id: To unique id of the segment
        :param reservation_id: The list of reservation Ids
        :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 InsightsSegmentsInstance
        c                 S   rW   rP   r.   rX   r.   r.   r/   rZ   X  r[   z1InsightsSegmentsList.page_async.<locals>.<lambda>r\   rb   rc   rd   re   rf   rg   N)r
   rl   r	   rm   r<   rK   r@   r;   rn   r.   r.   r/   rK   >  s(   
zInsightsSegmentsList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of InsightsSegmentsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InsightsSegmentsInstance
        rf   )r<   domaintwiliorequestr;   r+   rq   rp   r.   r.   r/   get_pagem  s   	zInsightsSegmentsList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of InsightsSegmentsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InsightsSegmentsInstance
        rf   N)r<   rr   rs   request_asyncr;   ru   r.   r.   r/   get_page_asyncy  s   	z#InsightsSegmentsList.get_page_asyncc                 C   r1   )r2   z(<Twilio.FlexApi.V1.InsightsSegmentsList>r.   r3   r.   r.   r/   r4     r>   zInsightsSegmentsList.__repr__)r5   r6   r7   r   r)   r
   unsetr   r9   objectr   r   intr   r   rH   r   rL   rN   rT   r;   rG   rK   rv   rx   r4   r:   r.   r.   r,   r/   r?   s   s    


&


&


%


&





1





/r?   N)r8   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    $H