o
    f>h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dedeeef dede	e f fdd	Z
edddZd
efddZd
efddZdddZdddZd
ef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__IN_PROGRESS	COMPLETEDFAILED r   r   ^/var/www/html/venv/lib/python3.10/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| _||pb| 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
   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__returnTranscriptionContextc                 C   s.   | j du 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,   )r3   r8   _versionr2   r4   r   r   r   _proxyQ   s   
zTranscriptionInstance._proxyc                 C   
   | j  S )p
        Deletes the TranscriptionInstance


        :returns: True if delete succeeds, False otherwise
        )r;   deleter:   r   r   r   r>   a      
zTranscriptionInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the TranscriptionInstance


        :returns: True if delete succeeds, False otherwise
        N)r;   delete_asyncr:   r   r   r   rB   j      z"TranscriptionInstance.delete_asyncc                 C   r<   )g
        Fetch the TranscriptionInstance


        :returns: The fetched TranscriptionInstance
        )r;   fetchr:   r   r   r   rE   s   r?   zTranscriptionInstance.fetchc                    r@   )
        Asynchronous coroutine to fetch the TranscriptionInstance


        :returns: The fetched TranscriptionInstance
        N)r;   fetch_asyncr:   r   r   r   rG   |   rC   z!TranscriptionInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z1TranscriptionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Api.V2010.TranscriptionInstance {}>joinr2   itemsrN   r4   contextr   r   r   __repr__      
zTranscriptionInstance.__repr__N)r7   r8   )r7   r   )r   r   r   objectr   r   r   strr   r   r.   propertyr;   boolr>   rB   rE   rG   rZ   __classcell__r   r   r5   r   r      s(    
!	
	
		r   c                       sp   e Zd Zdededef fddZdefddZdefd	d
Zde	fddZ
de	fddZdefddZ  ZS )r8   r   r   r    c                    s0   t  | ||d| _djdi | 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}.jsonNr   r-   r.   r2   rN   _uri)r4   r   r   r    r5   r   r   r.      s   zTranscriptionContext.__init__r7   c                 C   s   t i }| jjd| j|dS )r=   DELETEmethodr+   headers)r   ofr9   r>   rc   r4   rg   r   r   r   r>      s   
zTranscriptionContext.deletec                    s&   t i }| jjd| j|dI dH S )rA   rd   re   N)r   rh   r9   rB   rc   ri   r   r   r   rB      s
   
z!TranscriptionContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )rD   application/jsonAcceptGETre   r   r    r,   )r   rh   r9   rE   rc   r   r2   r4   rg   r   r   r   r   rE      s   
zTranscriptionContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	rF   rj   rk   rl   re   Nr   r    r,   )r   rh   r9   rG   rc   r   r2   rm   r   r   r   rG      s   
z TranscriptionContext.fetch_asyncc                 C   rH   )rI   rJ   c                 s   rK   rL   rM   rO   r   r   r   rS      rT   z0TranscriptionContext.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.TranscriptionContext {}>rU   rX   r   r   r   rZ      r[   zTranscriptionContext.__repr__)r   r   r   r   r^   r.   r`   r>   rB   r   rE   rG   rZ   ra   r   r   r5   r   r8      s    r8   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 )TranscriptionPager   r7   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   r9   r2   )r4   r   r   r   r   get_instance      zTranscriptionPage.get_instancec                 C      dS )rI   z$<Twilio.Api.V2010.TranscriptionPage>r   r:   r   r   r   rZ         zTranscriptionPage.__repr__N)	r   r   r   r   r^   r   r   ro   rZ   r   r   r   r   rn      s    
rn   c                	       s  e Zd Zdedef fddZ		d#dee dee dee	 fd	d
Z
		d#dee dee dee	 fddZ		d#dee dee dee	 fddZ		d#dee dee dee	 fddZejejej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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defddZdedefdd Zdefd!d"Z  ZS )$TranscriptionListr   r   c                    s.   t  | d|i| _djdi | 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.jsonNr   rb   )r4   r   r   r5   r   r   r.     s   zTranscriptionList.__init__Nlimit	page_sizer7   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
        ru   ru   rt   )r9   read_limitspagestreamr4   rt   ru   limitsrx   r   r   r   ry     s   zTranscriptionList.streamc                    s8   | 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
        ru   rv   Nrt   )r9   rw   
page_asyncstream_asyncrz   r   r   r   r}   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
        rt   ru   )listry   r4   rt   ru   r   r   r   r   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 r\   r   )rP   recordr   r   r   
<listcomp>|  s
    z0TranscriptionList.list_async.<locals>.<listcomp>r~   N)r}   r   r   r   r   
list_asynci  s   
zTranscriptionList.list_async
page_tokenpage_numberc                 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
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrj   rk   rl   rf   r+   paramsrg   )r   rh   r9   rx   rc   rn   r2   r4   r   r   ru   datarg   responser   r   r   rx     s   
zTranscriptionList.pagec                    sV   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
        r   r   r   rj   rk   rl   r   N)r   rh   r9   r|   rc   rn   r2   r   r   r   r   r|     s   
zTranscriptionList.page_async
target_urlc                 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
        rl   )r9   domaintwiliorequestrn   r2   r4   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
        rl   N)r9   r   r   request_asyncrn   r2   r   r   r   r   get_page_async  s   	z TranscriptionList.get_page_asyncr    c                 C      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,   r8   r9   r2   r4   r    r   r   r   r/     rp   zTranscriptionList.getc                 C   r   r   r   r   r   r   r   __call__  rp   zTranscriptionList.__call__c                 C   rq   )rI   z$<Twilio.Api.V2010.TranscriptionList>r   r:   r   r   r   rZ     rr   zTranscriptionList.__repr__)NN)r   r   r   r   r^   r.   r   intr   r   ry   r	   r}   r   r   r   r   unsetr   r]   rn   rx   r|   r   r   r8   r/   r   rZ   ra   r   r   r5   r   rs   	  s    







#



!

rs   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r8   rn   rs   r   r   r   r   <module>   s    $ve