o
    e8                     @   s   d 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	 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       sf   e Zd Z fddZdddZdddZejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )TranscriptionListc                    s2   t t| | d|i| _djdi | j| _dS )ab  
        Initialize the TranscriptionList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource

        :returns: twilio.rest.api.v2010.account.transcription.TranscriptionList
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionList
        account_sidz+/Accounts/{account_sid}/Transcriptions.jsonN )superr   __init__	_solutionformat_uri)selfversionr	   	__class__r
   ^/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/api/v2010/account/transcription.pyr      s   

zTranscriptionList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.api.v2010.account.transcription.TranscriptionInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r
   r
   r   r   #   s   zTranscriptionList.streamc                 C   s   t | j||dS )as  
        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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.api.v2010.account.transcription.TranscriptionInstance]
        )r   r   )listr   )r   r   r   r
   r
   r   r   :   s   zTranscriptionList.listc                 C   s6   t |||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 str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   TranscriptionPager   )r   
page_tokenpage_numberr   dataresponser
   r
   r   r   L   s   zTranscriptionList.pagec                 C   s"   | j jjd|}t| j || jS )aQ  
        Retrieve a specific page of TranscriptionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionPage
        r   )r   domaintwiliorequestr$   r   )r   
target_urlr(   r
   r
   r   get_page_   s
   

zTranscriptionList.get_pagec                 C      t | j| jd |dS a  
        Constructs a TranscriptionContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.transcription.TranscriptionContext
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionContext
        r	   r	   sidTranscriptionContextr   r   r   r1   r
   r
   r   getp      	zTranscriptionList.getc                 C   r.   r/   r2   r4   r
   r
   r   __call__{   r6   zTranscriptionList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Api.V2010.TranscriptionList>r
   r   r
   r
   r   __repr__      zTranscriptionList.__repr__)NN)__name__
__module____qualname__r   r   r   r   unsetr   r-   r5   r7   r;   __classcell__r
   r
   r   r   r      s    


r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )r$   c                    s   t t| || || _dS )a  
        Initialize the TranscriptionPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The SID of the Account that created the resource

        :returns: twilio.rest.api.v2010.account.transcription.TranscriptionPage
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionPage
        N)r   r$   r   r   )r   r   r(   solutionr   r
   r   r      s   
zTranscriptionPage.__init__c                 C   s   t | j|| jd dS )a  
        Build an instance of TranscriptionInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        r	   )r	   )TranscriptionInstancer   r   r   payloadr
   r
   r   get_instance   r6   zTranscriptionPage.get_instancec                 C   r8   )r9   z$<Twilio.Api.V2010.TranscriptionPage>r
   r:   r
   r
   r   r;      r<   zTranscriptionPage.__repr__)r=   r>   r?   r   rF   r;   rA   r
   r
   r   r   r$      s    r$   c                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	r3   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the TranscriptionContext

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource to fetch
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.api.v2010.account.transcription.TranscriptionContext
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionContext
        r0   z1/Accounts/{account_sid}/Transcriptions/{sid}.jsonNr
   )r   r3   r   r   r   r   )r   r   r	   r1   r   r
   r   r      s   zTranscriptionContext.__init__c                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the TranscriptionInstance

        :returns: The fetched TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        r   r    r!   r	   r1   r0   )r   fetchr   rC   r   rD   r
   r
   r   rI      s   zTranscriptionContext.fetchc                 C   s   | j jd| jdS )
        Deletes the TranscriptionInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErH   )r   deleter   r:   r
   r
   r   rL      s   zTranscriptionContext.deletec                 C   $   d dd | j D }d|S )r9    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>       z0TranscriptionContext.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.TranscriptionContext {}>joinr   itemsr   r   contextr
   r
   r   r;         
zTranscriptionContext.__repr__)r=   r>   r?   r   rI   rL   r;   rA   r
   r
   r   r   r3      s
    	r3   c                       s   e Zd ZG dd deZd( fdd	Zedd Zedd	 Zed
d Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zed d! Zd"d# Zd$d% Zd&d' Z  ZS ))rC   c                   @   s   e Zd ZdZdZdZdS )zTranscriptionInstance.Statuszin-progress	completedfailedN)r=   r>   r?   IN_PROGRESS	COMPLETEDFAILEDr
   r
   r
   r   Status   s    rc   Nc                    s   t t| | |d|dt|dt|d|dt|d|d|d|d	|d
|d|d|dd| _d| _||pS| jd	 d| _	dS )z
        Initialize the TranscriptionInstance

        :returns: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        r	   api_versiondate_createddate_updateddurationprice
price_unitrecording_sidr1   statustranscription_texttyper!   )r	   rd   re   rf   rg   rh   ri   rj   r1   rk   rl   rm   r!   Nr0   )
r   rC   r   r5   r   rfc2822_datetimedecimal_properties_contextr   )r   r   rE   r	   r1   r   r
   r   r      s"   zTranscriptionInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )aG  
        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
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionContext
        Nr	   r1   r0   )rq   r3   r   r   r:   r
   r
   r   _proxy  s   
	zTranscriptionInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r	   rp   r:   r
   r
   r   r	   $     
z!TranscriptionInstance.account_sidc                 C   rs   )zd
        :returns: The API version used to create the transcription
        :rtype: unicode
        rd   rt   r:   r
   r
   r   rd   ,  ru   z!TranscriptionInstance.api_versionc                 C   rs   )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        re   rt   r:   r
   r
   r   re   4  ru   z"TranscriptionInstance.date_createdc                 C   rs   )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        rf   rt   r:   r
   r
   r   rf   <  ru   z"TranscriptionInstance.date_updatedc                 C   rs   )ze
        :returns: The duration of the transcribed audio in seconds.
        :rtype: unicode
        rg   rt   r:   r
   r
   r   rg   D  ru   zTranscriptionInstance.durationc                 C   rs   )zT
        :returns: The charge for the transcription
        :rtype: unicode
        rh   rt   r:   r
   r
   r   rh   L  ru   zTranscriptionInstance.pricec                 C   rs   )z[
        :returns: The currency in which price is measured
        :rtype: unicode
        ri   rt   r:   r
   r
   r   ri   T  ru   z TranscriptionInstance.price_unitc                 C   rs   )zi
        :returns: The SID that identifies the transcription's recording
        :rtype: unicode
        rj   rt   r:   r
   r
   r   rj   \  ru   z#TranscriptionInstance.recording_sidc                 C   rs   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r1   rt   r:   r
   r
   r   r1   d  ru   zTranscriptionInstance.sidc                 C   rs   )zh
        :returns: The status of the transcription
        :rtype: TranscriptionInstance.Status
        rk   rt   r:   r
   r
   r   rk   l  ru   zTranscriptionInstance.statusc                 C   rs   )zZ
        :returns: The text content of the transcription.
        :rtype: unicode
        rl   rt   r:   r
   r
   r   rl   t  ru   z(TranscriptionInstance.transcription_textc                 C   rs   )zJ
        :returns: The transcription type
        :rtype: unicode
        rm   rt   r:   r
   r
   r   rm   |  ru   zTranscriptionInstance.typec                 C   rs   )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r!   rt   r:   r
   r
   r   r!     ru   zTranscriptionInstance.uric                 C   
   | j  S )rG   )rr   rI   r:   r
   r
   r   rI        
zTranscriptionInstance.fetchc                 C   rv   )rJ   )rr   rL   r:   r
   r
   r   rL     rw   zTranscriptionInstance.deletec                 C   rM   )r9   rN   c                 s   rO   rP   rQ   rR   r
   r
   r   rV     rW   z1TranscriptionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Api.V2010.TranscriptionInstance {}>rX   r[   r
   r
   r   r;     r]   zTranscriptionInstance.__repr__)N)r=   r>   r?   objectrc   r   propertyrr   r	   rd   re   rf   rg   rh   ri   rj   r1   rk   rl   rm   r!   rI   rL   r;   rA   r
   r
   r   r   rC      sD    













		rC   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r$   r3   rC   r
   r
   r
   r   <module>   s   '7