o
    f>hE                     @   s   d Z ddlmZ ddlmZmZmZmZ ddlmZm	Z	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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OptionalUnion)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZG dd deZG dd deZG dd deZ	 	dded	ee	e
f d
e	de	dee	 f
 fddZed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S )zTranscriptionInstance.Statuszin-progressstoppedN)__name__
__module____qualname__IN_PROGRESSSTOPPED r   r   c/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/api/v2010/account/call/transcription.pyStatus   s    r   c                   @   s   e Zd ZdZdZdZdS )TranscriptionInstance.Trackinbound_trackoutbound_trackboth_tracksN)r   r   r   INBOUND_TRACKOUTBOUND_TRACKBOTH_TRACKSr   r   r   r   Track   s    r   c                   @   s   e Zd ZdZdS )"TranscriptionInstance.UpdateStatusr   N)r   r   r   r   r   r   r   r   UpdateStatus#   s    r!   Nversionpayloadaccount_sidcall_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
|d| _|||p9| jd| _d | _d S )	Nr&   r$   r%   namestatusdate_updatedurir$   r%   r&   )super__init__getr&   r$   r%   r'   r(   r   rfc2822_datetimer)   r*   	_solution_context)selfr"   r#   r$   r%   r&   	__class__r   r   r-   0   s   
zTranscriptionInstance.__init__returnTranscriptionContextc                 C   s6   | j du rt| j| jd | 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+   )r1   r6   _versionr0   r2   r   r   r   _proxyK   s   
zTranscriptionInstance._proxyr(   r    c                 C   s   | j j|dS )
        Update the TranscriptionInstance

        :param status:

        :returns: The updated TranscriptionInstance
        r(   )r9   updater2   r(   r   r   r   r<   \   s   
zTranscriptionInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the TranscriptionInstance

        :param status:

        :returns: The updated TranscriptionInstance
        r;   N)r9   update_asyncr=   r   r   r   r?   j   s   
z"TranscriptionInstance.update_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 {}>joinr0   itemsrF   r2   contextr   r   r   __repr__x      
zTranscriptionInstance.__repr__)N)r5   r6   )r(   r    r5   r   )r   r   r   objectr   r   r!   r   r   strr   r   r-   propertyr9   r<   r?   rR   __classcell__r   r   r3   r   r      s<    


r   c                       s`   e Zd Zdedededef fddZddd	efd
dZddd	efddZd	efddZ	  Z
S )r6   r"   r$   r%   r&   c                    s2   t  | |||d| _djdi | j| _dS )a  
        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 this Transcription resource.
        :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with.
        :param sid: The SID of the Transcription resource, or the `name` used when creating the resource
        r+   zB/Accounts/{account_sid}/Calls/{call_sid}/Transcriptions/{sid}.jsonNr   r,   r-   r0   rF   _uri)r2   r"   r$   r%   r&   r3   r   r   r-      s   	zTranscriptionContext.__init__r(   r    r5   c                 C   sd   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 | jd
 dS )r:   r   !application/x-www-form-urlencodedContent-Typeapplication/jsonAcceptPOSTmethodr*   dataheadersr$   r%   r&   r+   )r	   ofr7   r<   rY   r   r0   r2   r(   ra   rb   r#   r   r   r   r<      s"   

zTranscriptionContext.updatec                    sl   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 | jd dS )r>   r   rZ   r[   r\   r]   r^   r_   Nr$   r%   r&   r+   )r	   rc   r7   r?   rY   r   r0   rd   r   r   r   r?      s$   

z!TranscriptionContext.update_asyncc                 C   r@   )rA   rB   c                 s   rC   rD   rE   rG   r   r   r   rK      rL   z0TranscriptionContext.__repr__.<locals>.<genexpr>z*<Twilio.Api.V2010.TranscriptionContext {}>rM   rP   r   r   r   rR      rS   zTranscriptionContext.__repr__)r   r   r   r   rU   r-   r   r<   r?   rR   rW   r   r   r3   r   r6      s    
"
"r6   c                       s<  e Zd Zdededef fddZejejejejejejejejejejejejejejfdeee	f dede	f d	eee	f d
eee	f deee	f deee	f dee
e	f deee	f deee	f dee
e	f deee	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ejejejejejejejejejejejfdeee	f dede	f d	eee	f d
eee	f deee	f deee	f dee
e	f deee	f deee	f dee
e	f deee	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fdd Z  ZS )!TranscriptionListr"   r$   r%   c                    s0   t  | ||d| _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 this Transcription resource.
        :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with.

        r$   r%   z</Accounts/{account_sid}/Calls/{call_sid}/Transcriptions.jsonNr   rX   )r2   r"   r$   r%   r3   r   r   r-      s   	zTranscriptionList.__init__r'   trackr   status_callback_urlstatus_callback_methodinbound_track_labeloutbound_track_labelpartial_resultslanguage_codetranscription_engineprofanity_filterspeech_modelhintsenable_automatic_punctuationintelligence_servicer5   c                 C   s   t ||||||t|||	t|
||t||d}t ddi}d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )a  
        Create the TranscriptionInstance

        :param name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription.
        :param track:
        :param status_callback_url: Absolute URL of the status callback.
        :param status_callback_method: The http method for the status_callback (one of GET, POST).
        :param inbound_track_label: Friendly name given to the Inbound Track
        :param outbound_track_label: Friendly name given to the Outbound Track
        :param partial_results: Indicates if partial results are going to be sent to the customer
        :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format
        :param transcription_engine: Definition of the transcription engine to be used, among those supported by Twilio
        :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks
        :param speech_model: Recognition model used by the transcription engine, among those supported by the provider
        :param hints: A Phrase contains words and phrase \"hints\" so that the speech recognition engine is more likely to recognize them.
        :param enable_automatic_punctuation: The provider will add punctuation to recognition result
        :param intelligence_service: The SID or unique name of the [Intelligence Service](https://www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators .

        :returns: The created TranscriptionInstance
        Namer   StatusCallbackUrlStatusCallbackMethodInboundTrackLabelOutboundTrackLabelPartialResultsLanguageCodeTranscriptionEngineProfanityFilterSpeechModelHintsEnableAutomaticPunctuationIntelligenceServicer[   rZ   r\   r]   r^   r_   r$   r%   rf   )	r	   rc   r   boolean_to_stringr7   createrY   r   r0   r2   r'   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   ra   rb   r#   r   r   r   r     s>   &
zTranscriptionList.createc                    s   t ||||||t|||	t|
||t||d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )a  
        Asynchronously create the TranscriptionInstance

        :param name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription.
        :param track:
        :param status_callback_url: Absolute URL of the status callback.
        :param status_callback_method: The http method for the status_callback (one of GET, POST).
        :param inbound_track_label: Friendly name given to the Inbound Track
        :param outbound_track_label: Friendly name given to the Outbound Track
        :param partial_results: Indicates if partial results are going to be sent to the customer
        :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format
        :param transcription_engine: Definition of the transcription engine to be used, among those supported by Twilio
        :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks
        :param speech_model: Recognition model used by the transcription engine, among those supported by the provider
        :param hints: A Phrase contains words and phrase \"hints\" so that the speech recognition engine is more likely to recognize them.
        :param enable_automatic_punctuation: The provider will add punctuation to recognition result
        :param intelligence_service: The SID or unique name of the [Intelligence Service](https://www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators .

        :returns: The created TranscriptionInstance
        rt   r[   rZ   r\   r]   r^   r_   Nr$   r%   rf   )	r	   rc   r   r   r7   create_asyncrY   r   r0   r   r   r   r   r   L  s@   &
zTranscriptionList.create_asyncr&   c                 C      t | j| jd | jd |dS z
        Constructs a TranscriptionContext

        :param sid: The SID of the Transcription resource, or the `name` used when creating the resource
        r$   r%   r+   r6   r7   r0   r2   r&   r   r   r   r.        zTranscriptionList.getc                 C   r   r   r   r   r   r   r   __call__  r   zTranscriptionList.__call__c                 C   s   dS )rA   z$<Twilio.Api.V2010.TranscriptionList>r   r8   r   r   r   rR     s   zTranscriptionList.__repr__)r   r   r   r   rU   r-   r	   unsetr   rT   boolr   r   r   r6   r.   r   rR   rW   r   r   r3   r   re      s    







	







M







	







Kre   N)__doc__r   typingr   r   r   r   twilio.baser   r   r	   twilio.base.instance_contextr
   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   r   r6   re   r   r   r   r   <module>   s    jg