U
    ^g%iS                     @   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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 - Video
    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	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZG dd deZdeeeef ee	e d fddZ
eddd	d
Zd dddZd dddZejfedef d dddZejfedef d dddZedddZ  ZS )TranscriptionsInstancec                   @   s   e Zd ZdZdZdZdS )TranscriptionsInstance.StatusstartedstoppedfailedN)__name__
__module____qualname__ZSTARTEDZSTOPPEDZFAILED r   r   g/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/video/v1/room/transcriptions.pyStatus   s   r   N)versionpayloadroom_sidttidc                    s   t  | |d| _|d| _|d| _|d| _t|d| _	t|d| _
t|d| _t|d| _t|d	| _|d
| _|d| _||p| jd| _d | _d S )Nr    account_sidr   statusdate_createddate_updated
start_timeend_timedurationurlconfigurationr   r    )super__init__getr    r!   r   r"   r
   Ziso8601_datetimer#   r$   r%   r&   integerr'   r(   r)   	_solution_context)selfr   r   r   r    	__class__r   r   r,   .   s0    zTranscriptionsInstance.__init__TranscriptionsContextreturnc                 C   s.   | j dk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: TranscriptionsContext for this TranscriptionsInstance
        Nr   r    r*   )r0   r4   _versionr/   r1   r   r   r   _proxyQ   s    
zTranscriptionsInstance._proxyc                 C   s
   | j  S )i
        Fetch the TranscriptionsInstance


        :returns: The fetched TranscriptionsInstance
        )r9   fetchr8   r   r   r   r;   a   s    zTranscriptionsInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the TranscriptionsInstance


        :returns: The fetched TranscriptionsInstance
        N)r9   fetch_asyncr8   r   r   r   r=   j   s    z"TranscriptionsInstance.fetch_asyncr   r"   r6   c                 C   s   | j j|dS )
        Update the TranscriptionsInstance

        :param status:

        :returns: The updated TranscriptionsInstance
        r"   )r9   updater1   r"   r   r   r   rA   s   s    
zTranscriptionsInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the TranscriptionsInstance

        :param status:

        :returns: The updated TranscriptionsInstance
        r@   N)r9   update_asyncrB   r   r   r   rD      s    
z#TranscriptionsInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>   s     z2TranscriptionsInstance.__repr__.<locals>.<genexpr>z+<Twilio.Video.V1.TranscriptionsInstance {}>joinr/   itemsrI   r1   contextr   r   r   __repr__   s    zTranscriptionsInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r,   propertyr9   r;   r=   r   unsetr   rA   rD   rT   __classcell__r   r   r2   r   r      s.    
#	


r   c                       s   e Zd Zeeed fddZedddZedddZe	j
fed	ef ed
ddZe	j
fed	ef ed
ddZedddZ  ZS )r4   )r   r   r    c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the TranscriptionsContext

        :param version: Version that contains the resource
        :param room_sid: The SID of the room with the transcriptions resource to update.
        :param ttid: The Twilio type id of the transcriptions resource to update.
        r*   z'/Rooms/{room_sid}/Transcriptions/{ttid}Nr+   r,   r/   rI   _uri)r1   r   r   r    r2   r   r   r,      s
    zTranscriptionsContext.__init__r5   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r:   application/jsonAcceptGETmethoduriheadersr   r    r*   )r   ofr7   r;   r[   r   r/   r1   rb   r   r   r   r   r;      s    
zTranscriptionsContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r<   r\   r]   r^   r_   Nr   r    r*   )r   rc   r7   r=   r[   r   r/   rd   r   r   r   r=      s    
  z!TranscriptionsContext.fetch_asyncr   r>   c                 C   s\   t d|i}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )r?   r   !application/x-www-form-urlencodedContent-Typer\   r]   POSTr`   ra   datarb   r   r    r*   )r   rc   r7   rA   r[   r   r/   r1   r"   ri   rb   r   r   r   r   rA      s(     
   zTranscriptionsContext.updatec                    sb   t d|i}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )rC   r   re   rf   r\   r]   rg   rh   Nr   r    r*   )r   rc   r7   rD   r[   r   r/   rj   r   r   r   rD      s(     
   z"TranscriptionsContext.update_asyncc                 C   s$   d dd | j D }d|S )rE   rF   c                 s   s   | ]\}}d  ||V  qdS rG   rH   rJ   r   r   r   rN      s     z1TranscriptionsContext.__repr__.<locals>.<genexpr>z*<Twilio.Video.V1.TranscriptionsContext {}>rO   rR   r   r   r   rT     s    zTranscriptionsContext.__repr__)r   r   r   r   rV   r,   r   r;   r=   r   rX   r   rU   rA   rD   rT   rY   r   r   r2   r   r4      s   
"
!r4   c                   @   s2   e Zd Zeeef edddZedddZdS )TranscriptionsPage)r   r6   c                 C   s   t | j|| jd dS )zt
        Build an instance of TranscriptionsInstance

        :param payload: Payload response from the API
        r   r   )r   r7   r/   )r1   r   r   r   r   get_instance&  s
      zTranscriptionsPage.get_instancer5   c                 C   s   dS )rE   z$<Twilio.Video.V1.TranscriptionsPage>r   r8   r   r   r   rT   0  s    zTranscriptionsPage.__repr__N)	r   r   r   r   rV   r   r   rm   rT   r   r   r   r   rk   $  s   
rk   c                       s  e Zd Zeed fddZejfee	e	f e
dddZejfee	e	f e
dddZd%ee ee ee
 d
ddZd&ee ee ee
 d
ddZd'ee ee ee
 d
ddZd(ee ee ee
 d
ddZejejejfeee	f eee	f eee	f edddZejejejfeee	f eee	f eee	f edddZeedddZeedddZeedddZeedd d!Zed"d#d$Z  ZS ))TranscriptionsList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the TranscriptionsList

        :param version: Version that contains the resource
        :param room_sid: The SID of the room with the transcriptions resources to read.

        r   z /Rooms/{room_sid}/TranscriptionsNrZ   )r1   r   r   r2   r   r   r,   ;  s
     zTranscriptionsList.__init__)r)   r6   c                 C   s^   t dt|i}t ddi}d|d< d|d< | jjd| j||d}t| j|| jd d	S )
z
        Create the TranscriptionsInstance

        :param configuration: A collection of properties that describe transcription behaviour.

        :returns: The created TranscriptionsInstance
        Configurationrf   re   r\   r]   rg   rh   r   rl   )	r   rc   r   rU   r7   creater[   r   r/   r1   r)   ri   rb   r   r   r   r   rp   K  s&          zTranscriptionsList.createc                    sd   t dt|i}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )z
        Asynchronously create the TranscriptionsInstance

        :param configuration: A collection of properties that describe transcription behaviour.

        :returns: The created TranscriptionsInstance
        ro   rf   re   r\   r]   rg   rh   Nr   rl   )	r   rc   r   rU   r7   create_asyncr[   r   r/   rq   r   r   r   rr   i  s&          zTranscriptionsList.create_asyncN)limit	page_sizer6   c                 C   s0   | j ||}| j|d d}| j ||d S )ad  
        Streams TranscriptionsInstance 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
        rt   rt   rs   )r7   read_limitspagestreamr1   rs   rt   Zlimitsrw   r   r   r   rx     s    zTranscriptionsList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )as  
        Asynchronously streams TranscriptionsInstance 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
        rt   ru   Nrs   )r7   rv   
page_asyncstream_asyncry   r   r   r   r{     s    zTranscriptionsList.stream_asyncc                 C   s   t | j||dS )a  
        Lists TranscriptionsInstance 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
        rs   rt   )listrx   r1   rs   rt   r   r   r   r}     s    zTranscriptionsList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists TranscriptionsInstance 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 )Nr   )rK   recordr   r   r   
<listcomp>  s   z1TranscriptionsList.list_async.<locals>.<listcomp>r|   N)r{   r~   r   r   r   
list_async  s    
zTranscriptionsList.list_async)
page_tokenpage_numberrt   r6   c                 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 TranscriptionsInstance 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 TranscriptionsInstance
        Z	PageTokenr   ZPageSizerf   re   r\   r]   r^   r`   ra   paramsrb   )r   rc   r7   rw   r[   rk   r/   r1   r   r   rt   ri   rb   responser   r   r   rw     s       zTranscriptionsList.pagec                    sT   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 TranscriptionsInstance 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 TranscriptionsInstance
        r   rf   re   r\   r]   r^   r   N)r   rc   r7   rz   r[   rk   r/   r   r   r   r   rz     s       zTranscriptionsList.page_async)
target_urlr6   c                 C   s"   | j jjd|}t| j || jS )a  
        Retrieve a specific page of TranscriptionsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of TranscriptionsInstance
        r^   )r7   domaintwiliorequestrk   r/   r1   r   r   r   r   r   get_page0  s    	zTranscriptionsList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of TranscriptionsInstance records from the API.
        Request is executed immediately

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

        :returns: Page of TranscriptionsInstance
        r^   N)r7   r   r   Zrequest_asyncrk   r/   r   r   r   r   get_page_async<  s    	z!TranscriptionsList.get_page_async)r    r6   c                 C   s   t | j| jd |dS z
        Constructs a TranscriptionsContext

        :param ttid: The Twilio type id of the transcriptions resource to update.
        r   r*   r4   r7   r/   r1   r    r   r   r   r-   H  s
      zTranscriptionsList.getc                 C   s   t | j| jd |dS r   r   r   r   r   r   __call__R  s
      zTranscriptionsList.__call__r5   c                 C   s   dS )rE   z$<Twilio.Video.V1.TranscriptionsList>r   r8   r   r   r   rT   \  s    zTranscriptionsList.__repr__)NN)NN)NN)NN) r   r   r   r   rV   r,   r   rX   r   rU   r   rp   rr   r   intr   rx   r	   r{   r   r}   r   rk   rw   rz   r   r   r4   r-   r   rT   rY   r   r   r2   r   rn   9  s|   

         


#


!

rn   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r4   rk   rn   r   r   r   r   <module>   s   $  