o
    e]                     @   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 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 )CompositionHookListc                    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
   X/var/www/html/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    F   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   e   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_urlr1   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   r7   r8   r
   r9   r
   r
   r   r;      r<   )
r$   r!   VideoLayoutAudioSourcesAudioSourcesExcluded
ResolutionFormatStatusCallbackStatusCallbackMethodTrimPOSTr(   r)   r0   )	r   r+   r   objectmapr   creater   CompositionHookInstance)r   r   r   video_layoutaudio_sourcesaudio_sources_excluded
resolutionr   status_callbackstatus_callback_methodtrimr0   payloadr
   r
   r   rI      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   rV   r
   r
   r   get      	zCompositionHookList.getc                 C   rS   rT   rW   rY   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__r   r   unsetr   r    r   r6   rI   rZ   r\   r`   __classcell__r
   r
   r   r   r	      s2    
#

!
'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 )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   r1   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
        )rJ   r   r   rR   r
   r
   r   get_instance   s   	z CompositionHookPage.get_instancec                 C   r]   )r^   z%<Twilio.Video.V1.CompositionHookPage>r
   r_   r
   r
   r   r`      ra   zCompositionHookPage.__repr__)rb   rc   rd   r   ri   r`   rf   r
   r
   r   r   r-      s    r-   c                	       sb   e 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 )rX   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
        rV   z/CompositionHooks/{sid}Nr
   )r   rX   r   r   r   r   )r   r   rV   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)   rV   rU   )r   fetchr   rJ   r   rh   r
   r
   r   rl     s   zCompositionHookContext.fetchc                 C   s   | j jd| jdS )
        Deletes the CompositionHookInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErk   )r   deleter   r_   r
   r
   r   ro   !  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   r7   r8   r
   r9   r
   r
   r   r;   C  r<   z/CompositionHookContext.update.<locals>.<lambda>c                 S   r7   r8   r
   r9   r
   r
   r   r;   D  r<   )
r$   r!   r=   r>   r?   rD   rA   r@   rB   rC   rE   rF   rV   rU   )
r   r+   r   rG   rH   r   updater   rJ   r   )r   r   r   rK   rL   rM   rQ   r   rN   rO   rP   r0   rR   r
   r
   r   rq   *  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>W      z2CompositionHookContext.__repr__.<locals>.<genexpr>z+<Twilio.Video.V1.CompositionHookContext {}>joinr   itemsr   r   contextr
   r
   r   r`   P     
zCompositionHookContext.__repr__)rb   rc   rd   r   rl   ro   r   re   rq   r`   rf   r
   r
   r   r   rX     s    	
&rX   c                	       s4  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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 )/rJ   c                   @   s   e Zd ZdZdZdS )zCompositionHookInstance.Formatmp4webmN)rb   rc   rd   MP4WEBMr
   r
   r
   r   rA   ]  s    rA   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_updatedrV   rL   rM   rK   rN   rQ   r   rO   rP   url)r   r   r   r   r   rV   rL   rM   rK   rN   rQ   r   rO   rP   r   N)	r   rJ   r   rZ   r   r,   _properties_contextr   )r   r   rR   rV   r   r
   r   r   a  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
        NrV   rU   )r   rX   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
        rV   r   r_   r
   r
   r   rV     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]
        rL   r   r_   r
   r
   r   rL     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]
        rM   r   r_   r
   r
   r   rM     r   z.CompositionHookInstance.audio_sources_excludedc                 C   r   )zq
        :returns: A JSON object that describes the video layout of the Composition
        :rtype: dict
        rK   r   r_   r
   r
   r   rK     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
        rN   r   r_   r
   r
   r   rN     r   z"CompositionHookInstance.resolutionc                 C   r   )z\
        :returns: Whether intervals with no media are clipped
        :rtype: bool
        rQ   r   r_   r
   r
   r   rQ     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
        rO   r   r_   r
   r
   r   rO     r   z'CompositionHookInstance.status_callbackc                 C   r   )zi
        :returns: The HTTP method we should use to call status_callback
        :rtype: unicode
        rP   r   r_   r
   r
   r   rP     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 )rj   )r   rl   r_   r
   r
   r   rl        
zCompositionHookInstance.fetchc                 C   r   )rm   )r   ro   r_   r
   r
   r   ro     r   zCompositionHookInstance.deletec                 C   s    | j j|||||||||	|
d
S )rp   )	r   rK   rL   rM   rQ   r   rN   rO   rP   )r   rq   )r   r   r   rK   rL   rM   rQ   r   rN   rO   rP   r
   r
   r   rq     s   zCompositionHookInstance.updatec                 C   rr   )r^   rs   c                 s   rt   ru   rv   rw   r
   r
   r   r{   A  r|   z3CompositionHookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Video.V1.CompositionHookInstance {}>r}   r   r
   r
   r   r`   :  r   z CompositionHookInstance.__repr__r8   )rb   rc   rd   rG   rA   r   propertyr   r   r   r   r   r   rV   rL   rM   rK   rN   rQ   r   rO   rP   r   rl   ro   r   re   rq   r`   rf   r
   r
   r   r   rJ   [  sV     















		
"rJ   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r-   rX   rJ   r
   r
   r
   r   <module>   s    M&W