
    piH                         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e      Z G d de      Z G d de      Z G d de      Zy)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            
            e Zd Z G d de      Z	 	 ddedeeef   dede	e   f fdZ
edd	       Zdefd
ZdefdZddZddZdefdZ xZS )TranscriptionInstancec                       e Zd ZdZdZdZy)TranscriptionInstance.Statuszin-progress	completedfailedN)__name__
__module____qualname__IN_PROGRESS	COMPLETEDFAILED     m/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/api/v2010/account/transcription.pyStatusr      s    #	r   r!   versionpayloadaccount_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d      | _	        t        j                  |j                  d            | _        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )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/   r0   r1   	_solution_context)selfr"   r#   r$   r%   	__class__s        r    r4   zTranscriptionInstance.__init__0   s6    	!*1++m*D*1++m*D0;0L0LKK'1
 1<0L0LKK'1
 (/{{:'>&1&9&9'++g:N&O
)0\)B,3KK,H")++e"4@GH@U18=Q1R#*;;v#6	")++e"4 '?$((
 9=r   returnc                     | j                   7t        | j                  | j                  d   | j                  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
        r$   r%   r2   )r9   TranscriptionContext_versionr8   r:   s    r    _proxyzTranscriptionInstance._proxyQ   sE     == 0 NN=9NN5)DM
 }}r   c                 6    | j                   j                         S )p
        Deletes the TranscriptionInstance


        :returns: True if delete succeeds, False otherwise
        )rA   deleter@   s    r    rD   zTranscriptionInstance.deletea   s     {{!!##r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the TranscriptionInstance


        :returns: True if delete succeeds, False otherwise
        N)rA   delete_asyncr@   s    r    rG   z"TranscriptionInstance.delete_asyncj   s!      [[--////   '%'c                 6    | j                   j                         S )g
        Fetch the TranscriptionInstance


        :returns: The fetched TranscriptionInstance
        )rA   fetchr@   s    r    rK   zTranscriptionInstance.fetchs   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to fetch the TranscriptionInstance


        :returns: The fetched TranscriptionInstance
        N)rA   fetch_asyncr@   s    r    rN   z!TranscriptionInstance.fetch_async|   s!      [[,,....rH   c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r    	<genexpr>z1TranscriptionInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z+<Twilio.Api.V2010.TranscriptionInstance {}>joinr8   itemsrU   r:   contexts     r    __repr__zTranscriptionInstance.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr   )N)r<   r>   )r<   r   )r   r   r   objectr!   r   r   strr   r   r4   propertyrA   boolrD   rG   rK   rN   rb   __classcell__r;   s   @r    r   r      s     
* "== c3h= 	=
 c]=B  $ $0D 0#/M# Mr   r   c                   h     e Zd Zdededef fdZdefdZdefdZde	fdZ
de	fd	Zdefd
Z xZS )r>   r"   r$   r%   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)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.
        r2   z1/Accounts/{account_sid}/Transcriptions/{sid}.jsonNr   r3   r4   r8   rU   _uri)r:   r"   r$   r%   r;   s       r    r4   zTranscriptionContext.__init__   sG     	! '
 OGNN 
nn
	r   r<   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rC   DELETEmethodr1   headers)r   ofr?   rD   rl   r:   rq   s     r    rD   zTranscriptionContext.delete   s1     ))B-}}##8G#TTr   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rF   rn   ro   N)r   rr   r?   rG   rl   rs   s     r    rG   z!TranscriptionContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rJ   application/jsonAcceptGETro   r$   r%   r2   )r   rr   r?   rK   rl   r   r8   r:   rq   r#   s      r    rK   zTranscriptionContext.fetch   si     ))B-.--%%U		7%S$MM}5u%	
 	
r   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rM   rv   rw   rx   ro   Nr$   r%   r2   )r   rr   r?   rN   rl   r   r8   ry   s      r    rN   z TranscriptionContext.fetch_async   s~      ))B-.11dii 2 
 
 %MM}5u%	
 	
	
s   ABB 	8Bc                     dj                  d | j                  j                         D              }dj                  |      S )rP   rQ   c              3   F   K   | ]  \  }}d j                  ||        ywrS   rT   rV   s      r    rZ   z0TranscriptionContext.__repr__.<locals>.<genexpr>   r[   r\   z*<Twilio.Api.V2010.TranscriptionContext {}>r]   r`   s     r    rb   zTranscriptionContext.__repr__   s6     ((SDNN<P<P<RSS;BB7KKr   )r   r   r   r   rd   r4   rf   rD   rG   r   rK   rN   rb   rg   rh   s   @r    r>   r>      s_    
 
c 
 
&
U 
U
D 

, 
*
#8 
.L# Lr   r>   c                   2    e Zd Zdeeef   defdZdefdZy)TranscriptionPager#   r<   c                 L    t        | j                  || j                  d         S )zs
        Build an instance of TranscriptionInstance

        :param payload: Payload response from the API
        r$   )r$   )r   r?   r8   )r:   r#   s     r    get_instancezTranscriptionPage.get_instance   s%     %MM7}0M
 	
r   c                      y)rP   z$<Twilio.Api.V2010.TranscriptionPage>r   r@   s    r    rb   zTranscriptionPage.__repr__        6r   N)	r   r   r   r   rd   r   r   r   rb   r   r   r    r~   r~      s*    
DcN 
7L 
6# 6r   r~   c            	           e Zd Zdedef fdZ	 	 ddee   dee   dee	   fdZ
	 	 ddee   dee   dee	   fdZ	 	 ddee   dee   dee	   fd	Z	 	 ddee   dee   dee	   f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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ZdedefdZdedefdZdedefdZdedefdZdefdZ xZS )TranscriptionListr"   r$   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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   rk   )r:   r"   r$   r;   s      r    r4   zTranscriptionList.__init__  sF     	! ;
 IAHH 
nn
	r   limit	page_sizer<   c                     | j                   j                  ||      }| j                  |d         }| j                   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
        r   r   r   )r?   read_limitspagestreamr:   r   r   limitsr   s        r    r   zTranscriptionList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)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
        r   r   Nr   )r?   r   
page_asyncstream_asyncr   s        r    r   zTranscriptionList.stream_async6  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            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
        r   r   )listr   )r:   r   r   s      r    r   zTranscriptionList.listO  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )r:   r   r   records       r    
list_asynczTranscriptionList.list_asynci  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }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-urlencodedrv   rw   rx   rp   r1   paramsrq   )r   rr   r?   r   rl   r~   r8   r:   r   r   r   datarq   responses          r    r   zTranscriptionList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 !$..IIr   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	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   rv   rw   rx   r   N)r   rr   r?   r   rl   r~   r8   r   s          r    r   zTranscriptionList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 !$..II
s   A"B$B
%&B
target_urlc                     | j                   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
        rx   )r?   domaintwiliorequestr~   r8   r:   r   r   s      r    get_pagezTranscriptionList.get_page  s=     ==''..66ujI $..IIr   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)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
        rx   N)r?   r   r   request_asyncr~   r8   r   s      r    get_page_asyncz TranscriptionList.get_page_async  sJ      --44BB5*UU $..II Vs   4AA&Ar%   c                 L    t        | j                  | j                  d   |      S z
        Constructs a TranscriptionContext

        :param sid: The Twilio-provided string that uniquely identifies the Transcription resource to fetch.
        r$   r2   r>   r?   r8   r:   r%   s     r    r5   zTranscriptionList.get  %     $MMt~~m'D#
 	
r   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r    __call__zTranscriptionList.__call__  r   r   c                      y)rP   z$<Twilio.Api.V2010.TranscriptionList>r   r@   s    r    rb   zTranscriptionList.__repr__  r   r   )NN)r   r   r   r   rd   r4   r   intr	   r   r   r
   r   r   r   r   r   unsetr   rc   r~   r   r   r   r   r>   r5   r   rb   rg   rh   s   @r    r   r   	  s   
 
c 
(  $#';}; C=; 
'	(	;6  $#'A}A C=A 
,	-	A6  $#'
}
 C=
 
#	$	
8  $#'
}
 C=
 
#	$	
: *0*0,,(.	J#v+&J 3;'J f%	J
 
JF *0*0,,(.	J#v+&J 3;'J f%	J
 
JB
J3 
J+< 
J
Js 
J7H 
J
s 
3 

C 
$8 
6# 6r   r   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   r>   r~   r   r   r   r    <module>r      sg     L L L + 8 : 2 ' !sM, sMlbL? bLJ6 6*o6 o6r   