o
    O`j`                     @   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
 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)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                	       s   e Zd ZdZ fddZejejejejddfddZejejejejddfddZejejejejejejejfd	d
Z	dd Z
ejejejejejejejejejf	ddZdd Zdd Zdd Z  ZS )CompositionHookList PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                    s.   t t| | i | _djdi | j| _dS )a  
        Initialize the CompositionHookList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.video.v1.composition_hook.CompositionHookList
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookList
        z/CompositionHooksN )superr	   __init__	_solutionformat_uri)selfversion	__class__r   i/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/twilio/rest/video/v1/composition_hook.pyr      s   	zCompositionHookList.__init__Nc           	      C   s8   | j ||}| j|||||d d}| j ||d S )a  
        Streams CompositionHookInstance 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 bool enabled: Read only CompositionHook resources with an enabled value that matches this parameter
        :param datetime date_created_after: Read only CompositionHook resources created on or after this ISO 8601 datetime with time zone
        :param datetime date_created_before: Read only CompositionHook resources created before this ISO 8601 datetime with time zone
        :param unicode friendly_name: Read only CompositionHook resources with friendly names that match this string
        :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.video.v1.composition_hook.CompositionHookInstance]
        	page_size)enableddate_created_afterdate_created_beforefriendly_namer   limit)_versionread_limitspagestream)	r   r   r   r   r   r   r   limitsr   r   r   r   r   &   s   zCompositionHookList.streamc              	   C   s   t | j||||||dS )ai  
        Lists CompositionHookInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param bool enabled: Read only CompositionHook resources with an enabled value that matches this parameter
        :param datetime date_created_after: Read only CompositionHook resources created on or after this ISO 8601 datetime with time zone
        :param datetime date_created_before: Read only CompositionHook resources created before this ISO 8601 datetime with time zone
        :param unicode friendly_name: Read only CompositionHook resources with friendly names that match this string
        :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.video.v1.composition_hook.CompositionHookInstance]
        )r   r   r   r   r   r   )listr   )r   r   r   r   r   r   r   r   r   r   r!   I   s   zCompositionHookList.listc           
   
   C   sJ   t |t|t|||||d}| jjd| j|d}	t| j|	| jS )a  
        Retrieve a single page of CompositionHookInstance records from the API.
        Request is executed immediately

        :param bool enabled: Read only CompositionHook resources with an enabled value that matches this parameter
        :param datetime date_created_after: Read only CompositionHook resources created on or after this ISO 8601 datetime with time zone
        :param datetime date_created_before: Read only CompositionHook resources created before this ISO 8601 datetime with time zone
        :param unicode friendly_name: Read only CompositionHook resources with friendly names that match this string
        :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 CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookPage
        )EnabledDateCreatedAfterDateCreatedBeforeFriendlyName	PageTokenr   PageSizeGET)methoduriparams)	r   ofr   iso8601_datetimer   r   r   CompositionHookPager   )
r   r   r   r   r   
page_tokenpage_numberr   dataresponser   r   r   r   h   s   
zCompositionHookList.pagec                 C   s"   | j jjd|}t| j || jS )aQ  
        Retrieve a specific page of CompositionHookInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookPage
        r(   )r   domaintwiliorequestr.   r   )r   
target_urlr2   r   r   r   get_page   s
   

zCompositionHookList.get_pagec                 C   s^   t ||t|t|dd t|dd ||||	|
d
}| jjd| j|d}t| j|S )a  
        Create the CompositionHookInstance

        :param unicode friendly_name: A unique string to describe the resource
        :param bool enabled: Whether the composition hook is active
        :param dict video_layout: An object that describes the video layout of the composition hook
        :param list[unicode] audio_sources: An array of track names from the same group room to merge
        :param list[unicode] audio_sources_excluded: An array of track names to exclude
        :param unicode resolution: A string that describes the rows (width) and columns (height) of the generated composed video in pixels
        :param CompositionHookInstance.Format format: The container format of the media files used by the compositions created by the composition hook
        :param unicode status_callback: The URL we should call to send status information to your application
        :param unicode status_callback_method: The HTTP method we should use to call status_callback
        :param bool trim: Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook

        :returns: The created CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        c                 S      | S Nr   er   r   r   <lambda>       z,CompositionHookList.create.<locals>.<lambda>c                 S   r8   r9   r   r:   r   r   r   r<      r=   )
r%   r"   VideoLayoutAudioSourcesAudioSourcesExcluded
ResolutionFormatStatusCallbackStatusCallbackMethodTrimPOSTr)   r*   r1   )	r   r,   r   objectmapr   creater   CompositionHookInstance)r   r   r   video_layoutaudio_sourcesaudio_sources_excluded
resolutionr   status_callbackstatus_callback_methodtrimr1   payloadr   r   r   rJ      s   zCompositionHookList.createc                 C      t | j|dS a  
        Constructs a CompositionHookContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.video.v1.composition_hook.CompositionHookContext
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookContext
        sidCompositionHookContextr   r   rW   r   r   r   get      	zCompositionHookList.getc                 C   rT   rU   rX   rZ   r   r   r   __call__   r\   zCompositionHookList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Video.V1.CompositionHookList>r   r   r   r   r   __repr__      zCompositionHookList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r!   r   r7   rJ   r[   r]   ra   __classcell__r   r   r   r   r	      s4    
#

!
'r	   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )r.   r
   c                    s   t t| || || _dS )aG  
        Initialize the CompositionHookPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.video.v1.composition_hook.CompositionHookPage
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookPage
        N)r   r.   r   r   )r   r   r2   solutionr   r   r   r      s   

zCompositionHookPage.__init__c                 C   s   t | j|S )a  
        Build an instance of CompositionHookInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        )rK   r   r   rS   r   r   r   get_instance   s   	z CompositionHookPage.get_instancec                 C   r^   )r_   z%<Twilio.Video.V1.CompositionHookPage>r   r`   r   r   r   ra      rb   zCompositionHookPage.__repr__)rc   rd   re   rf   r   rk   ra   rh   r   r   r   r   r.      s
    r.   c                	       sf   e Zd ZdZ fddZdd Zdd Zejejejejejejejejejf	dd	Z	d
d Z
  ZS )rY   r
   c                    s2   t t| | d|i| _djdi | j| _dS )aZ  
        Initialize the CompositionHookContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.video.v1.composition_hook.CompositionHookContext
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookContext
        rW   z/CompositionHooks/{sid}Nr   )r   rY   r   r   r   r   )r   r   rW   r   r   r   r     s   

zCompositionHookContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the CompositionHookInstance

        :returns: The fetched CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        r(   r)   r*   rW   rV   )r   fetchr   rK   r   rj   r   r   r   rn     s   zCompositionHookContext.fetchc                 C   s   | j jd| jdS )
        Deletes the CompositionHookInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErm   )r   deleter   r`   r   r   r   rq   *  s   zCompositionHookContext.deletec                 C   sh   t ||t|t|dd t|dd ||||	|
d
}| jjd| j|d}t| j|| j	d dS )	  
        Update the CompositionHookInstance

        :param unicode friendly_name: A unique string to describe the resource
        :param bool enabled: Whether the composition hook is active
        :param dict video_layout: A JSON object that describes the video layout of the composition hook
        :param list[unicode] audio_sources: An array of track names from the same group room to merge
        :param list[unicode] audio_sources_excluded: An array of track names to exclude
        :param bool trim: Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook
        :param CompositionHookInstance.Format format: The container format of the media files used by the compositions created by the composition hook
        :param unicode resolution: A string that describes the columns (width) and rows (height) of the generated composed video in pixels
        :param unicode status_callback: The URL we should call to send status information to your application
        :param unicode status_callback_method: The HTTP method we should use to call status_callback

        :returns: The updated CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        c                 S   r8   r9   r   r:   r   r   r   r<   L  r=   z/CompositionHookContext.update.<locals>.<lambda>c                 S   r8   r9   r   r:   r   r   r   r<   M  r=   )
r%   r"   r>   r?   r@   rE   rB   rA   rC   rD   rF   rG   rW   rV   )
r   r,   r   rH   rI   r   updater   rK   r   )r   r   r   rL   rM   rN   rR   r   rO   rP   rQ   r1   rS   r   r   r   rs   3  s   zCompositionHookContext.updatec                 C   $   d dd | j D }d|S )r_    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>`      z2CompositionHookContext.__repr__.<locals>.<genexpr>z+<Twilio.Video.V1.CompositionHookContext {}>joinr   itemsr   r   contextr   r   r   ra   Y     
zCompositionHookContext.__repr__)rc   rd   re   rf   r   rn   rq   r   rg   rs   ra   rh   r   r   r   r   rY   
  s    	
&rY   c                	       s8  e Zd 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ed#d$ Zed%d& Zd'd( Zd)d* Zejejejejejejejejejf	d+d,Zd-d. Z  ZS )0rK   r
   c                   @   s   e Zd ZdZdZdS )zCompositionHookInstance.Formatmp4webmN)rc   rd   re   MP4WEBMr   r   r   r   rB   i  s    rB   Nc                    s   t t| | |d|d|dt|dt|d|d|d|d|d	|d
|d|d|d|d|dd| _d| _d|pX| jd i| _dS )z
        Initialize the CompositionHookInstance

        :returns: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        account_sidr   r   date_createddate_updatedrW   rM   rN   rL   rO   rR   r   rP   rQ   url)r   r   r   r   r   rW   rM   rN   rL   rO   rR   r   rP   rQ   r   N)	r   rK   r   r[   r   r-   _properties_contextr   )r   r   rS   rW   r   r   r   r   m  s&   z CompositionHookInstance.__init__c                 C   s&   | j du rt| j| 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: CompositionHookContext for this CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookContext
        NrW   rV   )r   rY   r   r   r`   r   r   r   _proxy  s   
	zCompositionHookInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r   r   r`   r   r   r   r        
z#CompositionHookInstance.account_sidc                 C   r   )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        r   r   r`   r   r   r   r     r   z%CompositionHookInstance.friendly_namec                 C   r   )zV
        :returns: Whether the CompositionHook is active
        :rtype: bool
        r   r   r`   r   r   r   r     r   zCompositionHookInstance.enabledc                 C   r   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        r   r   r`   r   r   r   r     r   z$CompositionHookInstance.date_createdc                 C   r   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        r   r   r`   r   r   r   r     r   z$CompositionHookInstance.date_updatedc                 C   r   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rW   r   r`   r   r   r   rW     r   zCompositionHookInstance.sidc                 C   r   )z
        :returns: The array of track names to include in the compositions created by the composition hook
        :rtype: list[unicode]
        rM   r   r`   r   r   r   rM     r   z%CompositionHookInstance.audio_sourcesc                 C   r   )z
        :returns: The array of track names to exclude from the compositions created by the composition hook
        :rtype: list[unicode]
        rN   r   r`   r   r   r   rN     r   z.CompositionHookInstance.audio_sources_excludedc                 C   r   )zq
        :returns: A JSON object that describes the video layout of the Composition
        :rtype: dict
        rL   r   r`   r   r   r   rL     r   z$CompositionHookInstance.video_layoutc                 C   r   )z
        :returns: The dimensions of the video image in pixels expressed as columns (width) and rows (height)
        :rtype: unicode
        rO   r   r`   r   r   r   rO     r   z"CompositionHookInstance.resolutionc                 C   r   )z\
        :returns: Whether intervals with no media are clipped
        :rtype: bool
        rR   r   r`   r   r   r   rR     r   zCompositionHookInstance.trimc                 C   r   )z
        :returns: The container format of the media files used by the compositions created by the composition hook
        :rtype: CompositionHookInstance.Format
        r   r   r`   r   r   r   r     r   zCompositionHookInstance.formatc                 C   r   )zj
        :returns: The URL to send status information to your application
        :rtype: unicode
        rP   r   r`   r   r   r   rP     r   z'CompositionHookInstance.status_callbackc                 C   r   )zi
        :returns: The HTTP method we should use to call status_callback
        :rtype: unicode
        rQ   r   r`   r   r   r   rQ     r   z.CompositionHookInstance.status_callback_methodc                 C   r   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r   r   r`   r   r   r   r   
  r   zCompositionHookInstance.urlc                 C   
   | j  S )rl   )r   rn   r`   r   r   r   rn        
zCompositionHookInstance.fetchc                 C   r   )ro   )r   rq   r`   r   r   r   rq     r   zCompositionHookInstance.deletec                 C   s    | j j|||||||||	|
d
S )rr   )	r   rL   rM   rN   rR   r   rO   rP   rQ   )r   rs   )r   r   r   rL   rM   rN   rR   r   rO   rP   rQ   r   r   r   rs   $  s   zCompositionHookInstance.updatec                 C   rt   )r_   ru   c                 s   rv   rw   rx   ry   r   r   r   r}   M  r~   z3CompositionHookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Video.V1.CompositionHookInstance {}>r   r   r   r   r   ra   F  r   z CompositionHookInstance.__repr__r9   )rc   rd   re   rf   rH   rB   r   propertyr   r   r   r   r   r   rW   rM   rN   rL   rO   rR   r   rP   rQ   r   rn   rq   r   rg   rs   ra   rh   r   r   r   r   rK   d  sX     















		
"rK   N)rf   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r.   rY   rK   r   r   r   r   <module>   s    P)Z