U
    ^g%iH                     @   s   d Z ddlm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 - Api
    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.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZG dd deZdeeeef ee	e d fddZ
eddd	d
ZedddZedddZd dddZd dddZedddZ  ZS )TranscriptionInstancec                   @   s   e Zd ZdZdZdZdS )zTranscriptionInstance.Statuszin-progress	completedfailedN)__name__
__module____qualname__ZIN_PROGRESSZ	COMPLETEDZFAILED r   r   j/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/api/v2010/account/transcription.pyStatus   s   r   N)versionpayloadaccount_sidsidc                    s   t  | |d| _|d| _t|d| _t|d| _|d| _	t
|d| _|d| _|d| _|d	| _|d
| _|d| _|d| _|d| _||p| jd| _d | _d S )Nr   api_versiondate_createddate_updateddurationprice
price_unitrecording_sidr   statustranscription_texttypeurir   r   )super__init__getr   r   r
   Zrfc2822_datetimer   r    r!   decimalr"   r#   r$   r   r%   r&   r'   r(   	_solution_context)selfr   r   r   r   	__class__r   r   r+   0   s,    zTranscriptionInstance.__init__TranscriptionContextreturnc                 C   s.   | j dkr(t| j| jd | jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: TranscriptionContext for this TranscriptionInstance
        Nr   r   r)   )r/   r3   _versionr.   r0   r   r   r   _proxyQ   s    
zTranscriptionInstance._proxyc                 C   s
   | j  S )p
        Deletes the TranscriptionInstance


        :returns: True if delete succeeds, False otherwise
        )r8   deleter7   r   r   r   r:   a   s    zTranscriptionInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the TranscriptionInstance


        :returns: True if delete succeeds, False otherwise
        N)r8   delete_asyncr7   r   r   r   r<   j   s    z"TranscriptionInstance.delete_asyncc                 C   s
   | j  S )g
        Fetch the TranscriptionInstance


        :returns: The fetched TranscriptionInstance
        )r8   fetchr7   r   r   r   r>   s   s    zTranscriptionInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the TranscriptionInstance


        :returns: The fetched TranscriptionInstance
        N)r8   fetch_asyncr7   r   r   r   r@   |   s    z!TranscriptionInstance.fetch_asyncc                 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     z1TranscriptionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Api.V2010.TranscriptionInstance {}>joinr.   itemsrE   r0   contextr   r   r   __repr__   s    zTranscriptionInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r+   propertyr8   boolr:   r<   r>   r@   rP   __classcell__r   r   r1   r   r      s    
!				r   c                       sl   e Zd Zeeed fddZedddZedddZe	dd	d
Z
e	dddZedddZ  ZS )r3   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )ar  
        Initialize the TranscriptionContext

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource to fetch.
        :param sid: The Twilio-provided string that uniquely identifies the Transcription resource to fetch.
        r)   z1/Accounts/{account_sid}/Transcriptions/{sid}.jsonNr*   r+   r.   rE   _uri)r0   r   r   r   r1   r   r   r+      s    zTranscriptionContext.__init__r4   c                 C   s   t i }| jjd| j|dS )r9   DELETEmethodr(   headers)r   ofr6   r:   rW   r0   r[   r   r   r   r:      s    
zTranscriptionContext.deletec                    s$   t i }| jjd| j|dI dH S )r;   rX   rY   N)r   r\   r6   r<   rW   r]   r   r   r   r<      s    
  z!TranscriptionContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r=   application/jsonAcceptGETrY   r   r   r)   )r   r\   r6   r>   rW   r   r.   r0   r[   r   r   r   r   r>      s    
zTranscriptionContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r?   r^   r_   r`   rY   Nr   r   r)   )r   r\   r6   r@   rW   r   r.   ra   r   r   r   r@      s    
  z TranscriptionContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rA   rB   c                 s   s   | ]\}}d  ||V  qdS rC   rD   rF   r   r   r   rJ      s     z0TranscriptionContext.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.TranscriptionContext {}>rK   rN   r   r   r   rP      s    zTranscriptionContext.__repr__)r   r   r   r   rR   r+   rT   r:   r<   r   r>   r@   rP   rU   r   r   r1   r   r3      s   r3   c                   @   s2   e Zd Zeeef edddZedddZdS )TranscriptionPage)r   r5   c                 C   s   t | j|| jd dS )zs
        Build an instance of TranscriptionInstance

        :param payload: Payload response from the API
        r   )r   )r   r6   r.   )r0   r   r   r   r   get_instance   s
      zTranscriptionPage.get_instancer4   c                 C   s   dS )rA   z$<Twilio.Api.V2010.TranscriptionPage>r   r7   r   r   r   rP      s    zTranscriptionPage.__repr__N)	r   r   r   r   rR   r   r   rc   rP   r   r   r   r   rb      s   
rb   c                       sf  e Zd Zeed fddZd ee ee ee	 dddZ
d!ee ee ee	 ddd	Zd"ee ee ee	 dd
dZd#ee ee ee	 dddZejejejfeeef eeef eeef edddZejejej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edddZeedddZedddZ  ZS )$TranscriptionList)r   r   c                    s*   t  | d|i| _djf | j| _dS )a  
        Initialize the TranscriptionList

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to read.

        r   z+/Accounts/{account_sid}/Transcriptions.jsonNrV   )r0   r   r   r1   r   r   r+     s     zTranscriptionList.__init__N)limit	page_sizer5   c                 C   s0   | j ||}| j|d d}| j ||d S )ac  
        Streams TranscriptionInstance 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 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
        rf   rf   re   )r6   read_limitspagestreamr0   re   rf   Zlimitsri   r   r   r   rj     s    zTranscriptionList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ar  
        Asynchronously streams TranscriptionInstance 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 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
        rf   rg   Nre   )r6   rh   
page_asyncstream_asyncrk   r   r   r   rm   6  s    zTranscriptionList.stream_asyncc                 C   s   t | j||dS )a   
        Lists TranscriptionInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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
        re   rf   )listrj   r0   re   rf   r   r   r   ro   O  s    zTranscriptionList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists TranscriptionInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :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   )rG   recordr   r   r   
<listcomp>|  s   z0TranscriptionList.list_async.<locals>.<listcomp>rn   N)rm   rp   r   r   r   
list_asynci  s    
zTranscriptionList.list_async)
page_tokenpage_numberrf   r5   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a  
        Retrieve a single page of TranscriptionInstance records from the API.
        Request is executed immediately

        :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 TranscriptionInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedr^   r_   r`   rZ   r(   paramsr[   )r   r\   r6   ri   rW   rb   r.   r0   rt   ru   rf   datar[   responser   r   r   ri     s       zTranscriptionList.pagec                    sT   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 TranscriptionInstance records from the API.
        Request is executed immediately

        :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 TranscriptionInstance
        rv   rw   rx   r^   r_   r`   ry   N)r   r\   r6   rl   rW   rb   r.   r{   r   r   r   rl     s       zTranscriptionList.page_async)
target_urlr5   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of TranscriptionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of TranscriptionInstance
        r`   )r6   domaintwiliorequestrb   r.   r0   r~   r}   r   r   r   get_page  s    	zTranscriptionList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of TranscriptionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of TranscriptionInstance
        r`   N)r6   r   r   Zrequest_asyncrb   r.   r   r   r   r   get_page_async  s    	z TranscriptionList.get_page_async)r   r5   c                 C   s   t | j| jd |dS z
        Constructs a TranscriptionContext

        :param sid: The Twilio-provided string that uniquely identifies the Transcription resource to fetch.
        r   r)   r3   r6   r.   r0   r   r   r   r   r,     s
      zTranscriptionList.getc                 C   s   t | j| jd |dS r   r   r   r   r   r   __call__  s
      zTranscriptionList.__call__r4   c                 C   s   dS )rA   z$<Twilio.Api.V2010.TranscriptionList>r   r7   r   r   r   rP     s    zTranscriptionList.__repr__)NN)NN)NN)NN)r   r   r   r   rR   r+   r   intr   r   rj   r	   rm   r   ro   rs   r   unsetr   rQ   rb   ri   rl   r   r   r3   r,   r   rP   rU   r   r   r1   r   rd   	  sh           


#


!

rd   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r3   rb   rd   r   r   r   r   <module>   s   $ve