U
    ^g%i9                     @   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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 - Intelligence
    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	serializevalues)InstanceResource)ListResource)Version)Pagec                       s@   e Zd ZdZeeeef ed fddZedddZ	  Z
S )SentenceInstancea  
    :ivar media_channel: The channel number.
    :ivar sentence_index: The index of the sentence in the transcript.
    :ivar start_time: Offset from the beginning of the transcript when this sentence starts.
    :ivar end_time: Offset from the beginning of the transcript when this sentence ends.
    :ivar transcript: Transcript text.
    :ivar sid: A 34 character string that uniquely identifies this Sentence.
    :ivar confidence:
    :ivar words: Detailed information for each of the words of the given Sentence.
    )versionpayloadtranscript_sidc                    s   t  | t|d| _t|d| _|d| _|d| _|d| _	|d| _
|d| _|d| _d	|i| _d S )
Nmedia_channelsentence_index
start_timeend_time
transcriptsid
confidencewordsr   )super__init__r	   integergetr   r   r   r   r   r   r   r   	_solution)selfr   r   r   	__class__ n/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/intelligence/v2/transcript/sentence.pyr   $   s      zSentenceInstance.__init__returnc                 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,SentenceInstance.__repr__.<locals>.<genexpr>z,<Twilio.Intelligence.V2.SentenceInstance {}>)joinr    itemsr*   )r!   contextr$   r$   r%   __repr__8   s    zSentenceInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r2   __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 )SentencePage)r   r'   c                 C   s   t | j|| jd dS )zn
        Build an instance of SentenceInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr    )r!   r   r$   r$   r%   get_instanceD   s
      zSentencePage.get_instancer&   c                 C   s   dS )r(   z%<Twilio.Intelligence.V2.SentencePage>r$   r!   r$   r$   r%   r2   N   s    zSentencePage.__repr__N)	r3   r4   r5   r   r7   r   r   r;   r2   r$   r$   r$   r%   r9   B   s   
r9   c                       s  e Zd Ze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 )SentenceList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the SentenceList

        :param version: Version that contains the resource
        :param transcript_sid: The unique SID identifier of the Transcript.

        r   z'/Transcripts/{transcript_sid}/SentencesN)r   r   r    r*   _uri)r!   r   r   r"   r$   r%   r   Y   s
     zSentenceList.__init__N)redactedword_timestampslimit	page_sizer'   c                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams SentenceInstance 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 bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences.
        :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`.
        :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
        rB   r?   r@   rB   rA   )r:   read_limitspagestreamr!   r?   r@   rA   rB   ZlimitsrE   r$   r$   r%   rF   i   s    zSentenceList.streamc                    s:   | j ||}| j|||d dI dH }| j ||d S )a  
        Asynchronously streams SentenceInstance 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 bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences.
        :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`.
        :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
        rB   rC   NrA   )r:   rD   
page_asyncstream_asyncrG   r$   r$   r%   rI      s    zSentenceList.stream_asyncc                 C   s   t | j||||dS )a   
        Lists SentenceInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences.
        :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`.
        :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@   rA   rB   )listrF   r!   r?   r@   rA   rB   r$   r$   r%   rK      s    zSentenceList.listc                    s(   dd | j ||||dI dH 2 I dH S )a/  
        Asynchronously lists SentenceInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences.
        :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`.
        :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$   )r+   recordr$   r$   r%   
<listcomp>   s   z+SentenceList.list_async.<locals>.<listcomp>rJ   N)rI   rL   r$   r$   r%   
list_async   s    
zSentenceList.list_async)r?   r@   
page_tokenpage_numberrB   r'   c           	      C   s^   t t|t||||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a  
        Retrieve a single page of SentenceInstance records from the API.
        Request is executed immediately

        :param redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences.
        :param word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`.
        :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 SentenceInstance
        ZRedactedZWordTimestampsZ	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)	r   ofr
   boolean_to_stringr:   rE   r>   r9   r    	r!   r?   r@   rP   rQ   rB   datar\   responser$   r$   r%   rE      s"    
   zSentenceList.pagec           	         sd   t t|t||||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of SentenceInstance records from the API.
        Request is executed immediately

        :param redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences.
        :param word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`.
        :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 SentenceInstance
        rR   rS   rT   rU   rV   rW   rX   N)	r   r]   r
   r^   r:   rH   r>   r9   r    r_   r$   r$   r%   rH     s"    
   zSentenceList.page_async)
target_urlr'   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of SentenceInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SentenceInstance
        rW   )r:   domaintwiliorequestr9   r    r!   rb   ra   r$   r$   r%   get_page:  s    	zSentenceList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of SentenceInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SentenceInstance
        rW   N)r:   rc   rd   Zrequest_asyncr9   r    rf   r$   r$   r%   get_page_asyncF  s    	zSentenceList.get_page_asyncr&   c                 C   s   dS )r(   z%<Twilio.Intelligence.V2.SentenceList>r$   r<   r$   r$   r%   r2   R  s    zSentenceList.__repr__)r3   r4   r5   r   r7   r   r   unsetr   boolobjectr   intr   r   rF   r   rI   r   rK   rO   r9   rE   rH   rg   rh   r2   r8   r$   r$   r"   r%   r=   W   s   

#

#

"

#




)




'r=   N)r6   typingr   r   r   r   r   r   r   Ztwilio.baser	   r
   r   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r9   r=   r$   r$   r$   r%   <module>   s   $*