B
    `:`                 @   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 )CompositionHookListz 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f | 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__ T/home/dcms/DCMS/lib/python3.7/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)_versionZread_limitspagestream)	r   r   r   r   r   r   r   Z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
        )EnabledZDateCreatedAfterZDateCreatedBeforeFriendlyNameZ	PageTokenr   ZPageSizeGET)methoduriparams)	r   ofr   iso8601_datetimer   r   r   CompositionHookPager   )
r   r   r   r   r   Z
page_tokenZ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   domainZtwiliorequestr&   r   )r   
target_urlr(   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 unicode audio_sources: An array of track names from the same group room to merge
        :param 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   | S )Nr   )er   r   r   <lambda>       z,CompositionHookList.create.<locals>.<lambda>c             S   s   | S )Nr   )r-   r   r   r   r.      r/   )
r   r   VideoLayoutAudioSourcesAudioSourcesExcluded
ResolutionFormatStatusCallbackStatusCallbackMethodTrimPOST)r!   r"   r'   )	r   r$   r   objectmapr   creater   CompositionHookInstance)r   r   r   video_layoutaudio_sourcesaudio_sources_excluded
resolutionr   status_callbackstatus_callback_methodtrimr'   payloadr   r   r   r;      s    
zCompositionHookList.createc             C   s   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   rE   r   r   r   get   s    	zCompositionHookList.getc             C   s   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
        )rE   )rF   r   )r   rE   r   r   r   __call__   s    	zCompositionHookList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Video.V1.CompositionHookList>r   )r   r   r   r   __repr__   s    zCompositionHookList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r   r   r,   r;   rG   rH   rI   __classcell__r   r   )r   r   r	      s*   !#r	   c                   s0   e Zd ZdZ fddZdd Zdd Z  ZS )r&   z 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| || || _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   r(   Zsolution)r   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
        )r<   r   )r   rD   r   r   r   get_instance   s    	z CompositionHookPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Video.V1.CompositionHookPage>r   )r   r   r   r   rI      s    zCompositionHookPage.__repr__)rJ   rK   rL   rM   r   rP   rI   rO   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 )rF   z 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| | d|i| _djf | 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
        rE   z/CompositionHooks/{sid}N)r
   rF   r   r   r   r   )r   r   rE   )r   r   r   r     s    

zCompositionHookContext.__init__c             C   s(   | j jd| jd}t| j || jd dS )z
        Fetch the CompositionHookInstance

        :returns: The fetched CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        r    )r!   r"   rE   )rE   )r   fetchr   r<   r   )r   rD   r   r   r   rQ     s    zCompositionHookContext.fetchc             C   s   | j jd| jdS )z
        Deletes the CompositionHookInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r!   r"   )r   deleter   )r   r   r   r   rS   *  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 )	a  
        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 unicode audio_sources: An array of track names from the same group room to merge
        :param 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   s   | S )Nr   )r-   r   r   r   r.   L  r/   z/CompositionHookContext.update.<locals>.<lambda>c             S   s   | S )Nr   )r-   r   r   r   r.   M  r/   )
r   r   r0   r1   r2   r7   r4   r3   r5   r6   r8   )r!   r"   r'   rE   )rE   )
r   r$   r   r9   r:   r   updater   r<   r   )r   r   r   r=   r>   r?   rC   r   r@   rA   rB   r'   rD   r   r   r   rT   3  s    
zCompositionHookContext.updatec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>`  s    z2CompositionHookContext.__repr__.<locals>.<genexpr>z+<Twilio.Video.V1.CompositionHookContext {}>)joinr   itemsr   )r   contextr   r   r   rI   Y  s    zCompositionHookContext.__repr__)rJ   rK   rL   rM   r   rQ   rS   r   rN   rT   rI   rO   r   r   )r   r   rF   
  s   	#rF   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 )0r<   z 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   e Zd ZdZdZdS )zCompositionHookInstance.FormatZmp4ZwebmN)rJ   rK   rL   ZMP4ZWEBMr   r   r   r   r4   i  s   r4   Nc                s   t t| | |d|d|dt|dt|d|d|d|d|d	|d
|d|d|d|d|dd| _d| _d|p| 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_updatedrE   r>   r?   r=   r@   rC   r   rA   rB   url)r]   r   r   r^   r_   rE   r>   r?   r=   r@   rC   r   rA   rB   r`   N)	r
   r<   r   rG   r   r%   _properties_contextr   )r   r   rD   rE   )r   r   r   r   m  s$    z CompositionHookInstance.__init__c             C   s&   | j dk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
        NrE   )rE   )rb   rF   r   r   )r   r   r   r   _proxy  s    	
zCompositionHookInstance._proxyc             C   s
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r]   )ra   )r   r   r   r   r]     s    z#CompositionHookInstance.account_sidc             C   s
   | j d S )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        r   )ra   )r   r   r   r   r     s    z%CompositionHookInstance.friendly_namec             C   s
   | j d S )zV
        :returns: Whether the CompositionHook is active
        :rtype: bool
        r   )ra   )r   r   r   r   r     s    zCompositionHookInstance.enabledc             C   s
   | j d S )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        r^   )ra   )r   r   r   r   r^     s    z$CompositionHookInstance.date_createdc             C   s
   | j d S )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        r_   )ra   )r   r   r   r   r_     s    z$CompositionHookInstance.date_updatedc             C   s
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rE   )ra   )r   r   r   r   rE     s    zCompositionHookInstance.sidc             C   s
   | j d S )z
        :returns: The array of track names to include in the compositions created by the composition hook
        :rtype: unicode
        r>   )ra   )r   r   r   r   r>     s    z%CompositionHookInstance.audio_sourcesc             C   s
   | j d S )z
        :returns: The array of track names to exclude from the compositions created by the composition hook
        :rtype: unicode
        r?   )ra   )r   r   r   r   r?     s    z.CompositionHookInstance.audio_sources_excludedc             C   s
   | j d S )zq
        :returns: A JSON object that describes the video layout of the Composition
        :rtype: dict
        r=   )ra   )r   r   r   r   r=     s    z$CompositionHookInstance.video_layoutc             C   s
   | j d S )z
        :returns: The dimensions of the video image in pixels expressed as columns (width) and rows (height)
        :rtype: unicode
        r@   )ra   )r   r   r   r   r@     s    z"CompositionHookInstance.resolutionc             C   s
   | j d S )z\
        :returns: Whether intervals with no media are clipped
        :rtype: bool
        rC   )ra   )r   r   r   r   rC     s    zCompositionHookInstance.trimc             C   s
   | j d S )z
        :returns: The container format of the media files used by the compositions created by the composition hook
        :rtype: CompositionHookInstance.Format
        r   )ra   )r   r   r   r   r     s    zCompositionHookInstance.formatc             C   s
   | j d S )zj
        :returns: The URL to send status information to your application
        :rtype: unicode
        rA   )ra   )r   r   r   r   rA     s    z'CompositionHookInstance.status_callbackc             C   s
   | j d S )zi
        :returns: The HTTP method we should use to call status_callback
        :rtype: unicode
        rB   )ra   )r   r   r   r   rB     s    z.CompositionHookInstance.status_callback_methodc             C   s
   | j d S )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r`   )ra   )r   r   r   r   r`   
  s    zCompositionHookInstance.urlc             C   s
   | j  S )z
        Fetch the CompositionHookInstance

        :returns: The fetched CompositionHookInstance
        :rtype: twilio.rest.video.v1.composition_hook.CompositionHookInstance
        )rc   rQ   )r   r   r   r   rQ     s    zCompositionHookInstance.fetchc             C   s
   | j  S )z
        Deletes the CompositionHookInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rc   rS   )r   r   r   r   rS     s    zCompositionHookInstance.deletec             C   s    | j j|||||||||	|
d
S )a  
        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 unicode audio_sources: An array of track names from the same group room to merge
        :param 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
        )	r   r=   r>   r?   rC   r   r@   rA   rB   )rc   rT   )r   r   r   r=   r>   r?   rC   r   r@   rA   rB   r   r   r   rT   $  s    zCompositionHookInstance.updatec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        rU   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )rV   rW   rX   r   r   r   rY   M  s    z3CompositionHookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Video.V1.CompositionHookInstance {}>)rZ   r   r[   r   )r   r\   r   r   r   rI   F  s    z CompositionHookInstance.__repr__)N)rJ   rK   rL   rM   r9   r4   r   propertyrc   r]   r   r   r^   r_   rE   r>   r?   r=   r@   rC   r   rA   rB   r`   rQ   rS   r   rN   rT   rI   rO   r   r   )r   r   r<   d  s4    		r<   N)rM   Ztwilio.baser   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r	   r&   rF   r<   r   r   r   r   <module>   s    P)Z