B
    `8                 @   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                s.   t t| | d|i| _djf | 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__ Z/home/dcms/DCMS/lib/python3.7/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)_versionZread_limitspagestream)r   r   r   Z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
        )Z	PageTokenr   ZPageSizeGET)methoduriparams)r   Zofr   r   r   TranscriptionPager   )r   Z
page_tokenZ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   domainZtwiliorequestr   r   )r   
target_urlr    r   r   r   get_page_   s    

zTranscriptionList.get_pagec             C   s   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   r%   r   r   r   getp   s    	zTranscriptionList.getc             C   s   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	   r%   )r&   r   r   )r   r%   r   r   r   __call__{   s    	zTranscriptionList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Api.V2010.TranscriptionList>r   )r   r   r   r   __repr__   s    zTranscriptionList.__repr__)NN)NN)__name__
__module____qualname__r   r   r   r   Zunsetr   r$   r'   r(   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    Zsolution)r   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   s    	zTranscriptionPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Api.V2010.TranscriptionPage>r   )r   r   r   r   r)      s    zTranscriptionPage.__repr__)r*   r+   r,   r   r0   r)   r-   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 )	r&   c                s0   t t| | ||d| _djf | 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
        )r	   r%   z1/Accounts/{account_sid}/Transcriptions/{sid}.jsonN)r
   r&   r   r   r   r   )r   r   r	   r%   )r   r   r   r      s    zTranscriptionContext.__init__c             C   s0   | j jd| jd}t| j || jd | jd dS )z
        Fetch the TranscriptionInstance

        :returns: The fetched TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        r   )r   r   r	   r%   )r	   r%   )r   fetchr   r.   r   )r   r/   r   r   r   r1      s    zTranscriptionContext.fetchc             C   s   | j jd| jdS )z
        Deletes the TranscriptionInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r   r   )r   deleter   )r   r   r   r   r3      s    zTranscriptionContext.deletec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>   s    z0TranscriptionContext.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.TranscriptionContext {}>)joinr   itemsr   )r   contextr   r   r   r)      s    zTranscriptionContext.__repr__)r*   r+   r,   r   r1   r3   r)   r-   r   r   )r   r   r&      s   	r&   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 ))r.   c               @   s   e Zd ZdZdZdZdS )zTranscriptionInstance.Statuszin-progressZ	completedfailedN)r*   r+   r,   ZIN_PROGRESSZ	COMPLETEDZFAILEDr   r   r   r   Status   s   r=   Nc                s   t t| | |d|dt|dt|d|dt|d|d|d|d	|d
|d|d|dd| _d| _||p| 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_sidr%   statustranscription_texttyper   )r	   r>   r?   r@   rA   rB   rC   rD   r%   rE   rF   rG   r   N)r	   r%   )
r
   r.   r   r'   r   Zrfc2822_datetimedecimal_properties_contextr   )r   r   r/   r	   r%   )r   r   r   r      s     zTranscriptionInstance.__init__c             C   s.   | j dk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	   r%   )r	   r%   )rJ   r&   r   r   )r   r   r   r   _proxy  s    	
zTranscriptionInstance._proxyc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r	   )rI   )r   r   r   r   r	   $  s    z!TranscriptionInstance.account_sidc             C   s
   | j d S )zd
        :returns: The API version used to create the transcription
        :rtype: unicode
        r>   )rI   )r   r   r   r   r>   ,  s    z!TranscriptionInstance.api_versionc             C   s
   | j d S )zt
        :returns: The RFC 2822 date and time in GMT that the resource was created
        :rtype: datetime
        r?   )rI   )r   r   r   r   r?   4  s    z"TranscriptionInstance.date_createdc             C   s
   | j d S )zy
        :returns: The RFC 2822 date and time in GMT that the resource was last updated
        :rtype: datetime
        r@   )rI   )r   r   r   r   r@   <  s    z"TranscriptionInstance.date_updatedc             C   s
   | j d S )ze
        :returns: The duration of the transcribed audio in seconds.
        :rtype: unicode
        rA   )rI   )r   r   r   r   rA   D  s    zTranscriptionInstance.durationc             C   s
   | j d S )zT
        :returns: The charge for the transcription
        :rtype: unicode
        rB   )rI   )r   r   r   r   rB   L  s    zTranscriptionInstance.pricec             C   s
   | j d S )z[
        :returns: The currency in which price is measured
        :rtype: unicode
        rC   )rI   )r   r   r   r   rC   T  s    z TranscriptionInstance.price_unitc             C   s
   | j d S )zi
        :returns: The SID that identifies the transcription's recording
        :rtype: unicode
        rD   )rI   )r   r   r   r   rD   \  s    z#TranscriptionInstance.recording_sidc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r%   )rI   )r   r   r   r   r%   d  s    zTranscriptionInstance.sidc             C   s
   | j d S )zh
        :returns: The status of the transcription
        :rtype: TranscriptionInstance.Status
        rE   )rI   )r   r   r   r   rE   l  s    zTranscriptionInstance.statusc             C   s
   | j d S )zZ
        :returns: The text content of the transcription.
        :rtype: unicode
        rF   )rI   )r   r   r   r   rF   t  s    z(TranscriptionInstance.transcription_textc             C   s
   | j d S )zJ
        :returns: The transcription type
        :rtype: unicode
        rG   )rI   )r   r   r   r   rG   |  s    zTranscriptionInstance.typec             C   s
   | j d S )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r   )rI   )r   r   r   r   r     s    zTranscriptionInstance.uric             C   s
   | j  S )z
        Fetch the TranscriptionInstance

        :returns: The fetched TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionInstance
        )rK   r1   )r   r   r   r   r1     s    zTranscriptionInstance.fetchc             C   s
   | j  S )z
        Deletes the TranscriptionInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rK   r3   )r   r   r   r   r3     s    zTranscriptionInstance.deletec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r4   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r5   r6   r7   r   r   r   r8     s    z1TranscriptionInstance.__repr__.<locals>.<genexpr>z+<Twilio.Api.V2010.TranscriptionInstance {}>)r9   r   r:   r   )r   r;   r   r   r   r)     s    zTranscriptionInstance.__repr__)N)r*   r+   r,   objectr=   r   propertyrK   r	   r>   r?   r@   rA   rB   rC   rD   r%   rE   rF   rG   r   r1   r3   r)   r-   r   r   )r   r   r.      s&   		r.   N)__doc__Ztwilio.baser   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r   r   r&   r.   r   r   r   r   <module>   s   '7