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fddZejejddfddZejejddfdd	Zejejejejejfd
dZ	dd Z
dd Zdd Zdd Z  ZS )MediaProcessorListc                    s.   t t| | i | _djdi | j| _dS )a
  
        Initialize the MediaProcessorList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.media.v1.media_processor.MediaProcessorList
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorList
        z/MediaProcessorsN )superr	   __init__	_solutionformat_uri)selfversion	__class__r
   W/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/media/v1/media_processor.pyr      s   	zMediaProcessorList.__init__c           	   	   C   s>   t ||t||||d}| jjd| j|d}t| j|S )a  
        Create the MediaProcessorInstance

        :param unicode extension: The Media Extension name or URL
        :param unicode extension_context: The Media Extension context
        :param dict extension_environment: The Media Extension environment
        :param unicode status_callback: The URL to send MediaProcessor event updates to your application
        :param unicode status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL
        :param unicode max_duration: Maximum MediaProcessor duration in minutes

        :returns: The created MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        )	ExtensionExtensionContextExtensionEnvironmentStatusCallbackStatusCallbackMethodMaxDurationPOSTmethoduridata)r   ofr   object_versioncreater   MediaProcessorInstance)	r   	extensionextension_contextextension_environmentstatus_callbackstatus_callback_methodmax_durationr   payloadr
   r
   r   r#   #   s   	zMediaProcessorList.createNc                 C   s4   | j ||}| j|||d d}| j ||d S )ae  
        Streams MediaProcessorInstance 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 MediaProcessorInstance.Order order: The sort order of the list
        :param MediaProcessorInstance.Status status: Status to filter by
        :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.media.v1.media_processor.MediaProcessorInstance]
        	page_size)orderstatusr,   limit)r"   read_limitspagestream)r   r-   r.   r/   r,   limitsr1   r
   r
   r   r2   @   s   zMediaProcessorList.streamc                 C   s   t | j||||dS )a  
        Lists MediaProcessorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param MediaProcessorInstance.Order order: The sort order of the list
        :param MediaProcessorInstance.Status status: Status to filter by
        :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.media.v1.media_processor.MediaProcessorInstance]
        )r-   r.   r/   r,   )listr2   )r   r-   r.   r/   r,   r
   r
   r   r4   Z   s   zMediaProcessorList.listc                 C   s:   t |||||d}| jjd| j|d}t| j|| jS )al  
        Retrieve a single page of MediaProcessorInstance records from the API.
        Request is executed immediately

        :param MediaProcessorInstance.Order order: The sort order of the list
        :param MediaProcessorInstance.Status status: Status to filter by
        :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 MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorPage
        )OrderStatus	PageTokenr   PageSizeGET)r   r   params)r   r    r"   r1   r   MediaProcessorPager   )r   r-   r.   
page_tokenpage_numberr,   r   responser
   r
   r   r1   o   s   zMediaProcessorList.pagec                 C   s"   | j jjd|}t| j || jS )aM  
        Retrieve a specific page of MediaProcessorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorPage
        r9   )r"   domaintwiliorequestr;   r   )r   
target_urlr>   r
   r
   r   get_page   s
   

zMediaProcessorList.get_pagec                 C      t | j|dS a  
        Constructs a MediaProcessorContext

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

        :returns: twilio.rest.media.v1.media_processor.MediaProcessorContext
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorContext
        sidMediaProcessorContextr"   r   rG   r
   r
   r   get      	zMediaProcessorList.getc                 C   rD   rE   rH   rJ   r
   r
   r   __call__   rL   zMediaProcessorList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z$<Twilio.Media.V1.MediaProcessorList>r
   r   r
   r
   r   __repr__      zMediaProcessorList.__repr__)__name__
__module____qualname__r   r   unsetr#   r2   r4   r1   rC   rK   rM   rQ   __classcell__r
   r
   r   r   r	      s$    





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 )aB  
        Initialize the MediaProcessorPage

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

        :returns: twilio.rest.media.v1.media_processor.MediaProcessorPage
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorPage
        N)r   r;   r   r   )r   r   r>   solutionr   r
   r   r      s   

zMediaProcessorPage.__init__c                 C   s   t | j|S )a  
        Build an instance of MediaProcessorInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        )r$   r"   r   r+   r
   r
   r   get_instance      	zMediaProcessorPage.get_instancec                 C   rN   )rO   z$<Twilio.Media.V1.MediaProcessorPage>r
   rP   r
   r
   r   rQ      rR   zMediaProcessorPage.__repr__)rS   rT   rU   r   rZ   rQ   rW   r
   r
   r   r   r;      s    r;   c                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	rI   c                    s2   t t| | d|i| _djdi | j| _dS )aU  
        Initialize the MediaProcessorContext

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

        :returns: twilio.rest.media.v1.media_processor.MediaProcessorContext
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorContext
        rG   z/MediaProcessors/{sid}Nr
   )r   rI   r   r   r   r   )r   r   rG   r   r
   r   r      s   

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

        :returns: The fetched MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        r9   )r   r   rG   rF   )r"   fetchr   r$   r   rY   r
   r
   r   r]      s   zMediaProcessorContext.fetchc                 C   s8   t d|i}| jjd| j|d}t| j|| jd dS )  
        Update the MediaProcessorInstance

        :param MediaProcessorInstance.UpdateStatus status: The status of the MediaProcessor

        :returns: The updated MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        r6   r   r   rG   rF   )r   r    r"   updater   r$   r   )r   r.   r   r+   r
   r
   r   r_      s   	zMediaProcessorContext.updatec                 C   $   d dd | j D }d|S )rO    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>      z1MediaProcessorContext.__repr__.<locals>.<genexpr>z*<Twilio.Media.V1.MediaProcessorContext {}>joinr   itemsr   r   contextr
   r
   r   rQ        
zMediaProcessorContext.__repr__)rS   rT   rU   r   r]   r_   rQ   rW   r
   r
   r   r   rI      s
    rI   c                       s  e Zd ZG dd deZG dd de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d$d% Zd&d' Zd(d) Z  ZS )+r$   c                   @   s   e Zd ZdZdZdZdS )zMediaProcessorInstance.StatusfailedstartedendedN)rS   rT   rU   FAILEDSTARTEDENDEDr
   r
   r
   r   r6     s    r6   c                   @   s   e Zd ZdZdS )z#MediaProcessorInstance.UpdateStatusrs   N)rS   rT   rU   rv   r
   r
   r
   r   UpdateStatus  s    rw   c                   @   s   e Zd ZdZdZdS )zMediaProcessorInstance.OrderascdescN)rS   rT   rU   ASCDESCr
   r
   r
   r   r5   "  s    r5   Nc                    s   t t| | |d|dt|dt|d|d|d|d|d|d	|d
|dt|dd| _d| _d|pO| jd i| _	dS )z
        Initialize the MediaProcessorInstance

        :returns: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorInstance
        account_sidrG   date_createddate_updatedr%   r&   r.   urlended_reasonr(   r)   r*   )r|   rG   r}   r~   r%   r&   r.   r   r   r(   r)   r*   N)
r   r$   r   rK   r   iso8601_datetimeinteger_properties_contextr   )r   r   r+   rG   r   r
   r   r   &  s    zMediaProcessorInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )aC  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: MediaProcessorContext for this MediaProcessorInstance
        :rtype: twilio.rest.media.v1.media_processor.MediaProcessorContext
        NrG   rF   )r   rI   r"   r   rP   r
   r
   r   _proxyC  s   
	zMediaProcessorInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r|   r   rP   r
   r
   r   r|   P     
z"MediaProcessorInstance.account_sidc                 C   r   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rG   r   rP   r
   r
   r   rG   X  r   zMediaProcessorInstance.sidc                 C   r   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        r}   r   rP   r
   r
   r   r}   `  r   z#MediaProcessorInstance.date_createdc                 C   r   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        r~   r   rP   r
   r
   r   r~   h  r   z#MediaProcessorInstance.date_updatedc                 C   r   )zS
        :returns: The Media Extension name or URL
        :rtype: unicode
        r%   r   rP   r
   r
   r   r%   p  r   z MediaProcessorInstance.extensionc                 C   r   )zO
        :returns: The Media Extension context
        :rtype: unicode
        r&   r   rP   r
   r
   r   r&   x  r   z(MediaProcessorInstance.extension_contextc                 C   r   )zj
        :returns: The status of the MediaProcessor
        :rtype: MediaProcessorInstance.Status
        r.   r   rP   r
   r
   r   r.     r   zMediaProcessorInstance.statusc                 C   r   )zT
        :returns: The absolute URL of the resource
        :rtype: unicode
        r   r   rP   r
   r
   r   r     r   zMediaProcessorInstance.urlc                 C   r   )zY
        :returns: The reason why a MediaProcessor ended
        :rtype: unicode
        r   r   rP   r
   r
   r   r     r   z#MediaProcessorInstance.ended_reasonc                 C   r   )zr
        :returns: The URL to which Twilio will send MediaProcessor event updates
        :rtype: unicode
        r(   r   rP   r
   r
   r   r(     r   z&MediaProcessorInstance.status_callbackc                 C   r   )zw
        :returns: The HTTP method Twilio should use to call the `status_callback` URL
        :rtype: unicode
        r)   r   rP   r
   r
   r   r)     r   z-MediaProcessorInstance.status_callback_methodc                 C   r   )z^
        :returns: Maximum MediaProcessor duration in seconds
        :rtype: unicode
        r*   r   rP   r
   r
   r   r*     r   z#MediaProcessorInstance.max_durationc                 C   s
   | j  S )r\   )r   r]   rP   r
   r
   r   r]     s   
zMediaProcessorInstance.fetchc                 C   s   | j |S )r^   )r   r_   )r   r.   r
   r
   r   r_     r[   zMediaProcessorInstance.updatec                 C   r`   )rO   ra   c                 s   rb   rc   rd   re   r
   r
   r   ri     rj   z2MediaProcessorInstance.__repr__.<locals>.<genexpr>z+<Twilio.Media.V1.MediaProcessorInstance {}>rk   rn   r
   r
   r   rQ     rp   zMediaProcessorInstance.__repr__)N)rS   rT   rU   r!   r6   rw   r5   r   propertyr   r|   rG   r}   r~   r%   r&   r.   r   r   r(   r)   r*   r]   r_   rQ   rW   r
   r
   r   r   r$     sD    












	r$   N)__doc__twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r;   rI   r$   r
   r
   r
   r   <module>   s    *&7