
    i?1ig                         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e      Z G d de      Z G d de      Z G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Media
    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                        e Zd Z G d de      Z G d de      Z G d de      Z	 	 ddedee	e
f   d	ee	   f fd
Zedd       ZddZddZ	 	 	 	 ddZ	 	 	 	 ddZde	fdZ xZS )MediaProcessorInstancec                       e Zd ZdZdZy)MediaProcessorInstance.OrderascdescN)__name__
__module____qualname__ASCDESC     n/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/twilio/rest/media/v1/media_processor.pyOrderr      s    r   r!   c                       e Zd ZdZdZdZy)MediaProcessorInstance.StatusfailedstartedendedN)r   r   r   FAILEDSTARTEDENDEDr   r   r    Statusr#      s    r   r*   c                       e Zd ZdZy)#MediaProcessorInstance.UpdateStatusr&   N)r   r   r   r)   r   r   r    UpdateStatusr,   $   s    r   r-   versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d      | _	        |j                  d      | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        t        j                   |j                  d            | _        d|xs | j                  i| _        d | _        y )Naccount_sidr0   date_createddate_updated	extensionextension_contextstatusurlended_reasonstatus_callbackstatus_callback_methodmax_duration)super__init__getr2   r0   r   iso8601_datetimer3   r4   r5   r6   r7   r8   r9   r:   r;   integerr<   	_solution_context)selfr.   r/   r0   	__class__s       r    r>   zMediaProcessorInstance.__init__6   s0    	!*1++m*D")++e"40;0L0LKK'1
 1<0L0LKK'1
 )0K(@07<O0PAHXAV")++e"4+2;;~+F.5kk:K.L5<[[$6
# ,7+>+>KK',

 3?$((
 :>r   returnc                     | j                   )t        | j                  | j                  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: MediaProcessorContext for this MediaProcessorInstance
        r0   r0   )rC   MediaProcessorContext_versionrB   rD   s    r    _proxyzMediaProcessorInstance._proxyU   s9     == 1NN5)DM }}r   c                 6    | j                   j                         S )i
        Fetch the MediaProcessorInstance


        :returns: The fetched MediaProcessorInstance
        )rL   fetchrK   s    r    rO   zMediaProcessorInstance.fetchd   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to fetch the MediaProcessorInstance


        :returns: The fetched MediaProcessorInstance
        N)rL   fetch_asyncrK   s    r    rR   z"MediaProcessorInstance.fetch_asyncm   s!      [[,,....s   '%'c                 :    | j                   j                  |      S )
        Update the MediaProcessorInstance

        :param status:

        :returns: The updated MediaProcessorInstance
        r7   )rL   updaterD   r7   s     r    rV   zMediaProcessorInstance.updatev   s#     {{!! " 
 	
r   c                 V   K   | j                   j                  |       d{   S 7 w)
        Asynchronous coroutine to update the MediaProcessorInstance

        :param status:

        :returns: The updated MediaProcessorInstance
        rU   N)rL   update_asyncrW   s     r    rZ   z#MediaProcessorInstance.update_async   s1      [[-- . 
 
 	
 
s    )')c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r    	<genexpr>z2MediaProcessorInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z+<Twilio.Media.V1.MediaProcessorInstance {}>joinrB   itemsra   rD   contexts     r    __repr__zMediaProcessorInstance.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr   )N)rF   rI   )rF   r   )r7   r,   rF   r   )r   r   r   objectr!   r*   r-   r   r   strr   r   r>   propertyrL   rO   rR   rV   rZ   rn   __classcell__rE   s   @r    r   r      s      
v   OS>>)-c3h>>Fsm>>  #/
;
	!

;
	!
M# Mr   r   c                   l     e Zd Zdedef fdZdefdZdefdZdddefd	Z	dddefd
Z
defdZ xZS )rI   r.   r0   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the MediaProcessorContext

        :param version: Version that contains the resource
        :param sid: The SID of the MediaProcessor resource to update.
        r0   z/MediaProcessors/{sid}Nr   )r=   r>   rB   ra   _uri)rD   r.   r0   rE   s      r    r>   zMediaProcessorContext.__init__   s@     	! 3
 4,33EdnnE	r   rF   c                     | j                   j                  d| j                        }t        | j                   || j                  d         S )rN   GETmethodurir0   rH   )rJ   rO   rv   r   rB   rD   r/   s     r    rO   zMediaProcessorContext.fetch   sL     --%%		 & 

 &MMu%
 	
r   c                    K   | j                   j                  d| j                         d{   }t        | j                   || j                  d         S 7 )w)rQ   rx   ry   Nr0   rH   )rJ   rR   rv   r   rB   r|   s     r    rR   z!MediaProcessorContext.fetch_async   sZ      11		 2 
 

 &MMu%
 	

s   +AA*Ar7   r,   c                     t        j                  d|i      }| j                  j                  d| j                  |      }t        | j                  || j                  d         S )rT   r*   POSTrz   r{   datar0   rH   )r   ofrJ   rV   rv   r   rB   rD   r7   r   r/   s       r    rV   zMediaProcessorContext.update   sc     yy&
 --&&		 ' 
 &dmmW$..QVBWXXr   c                    K   t        j                  d|i      }| j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)rY   r*   r   r   Nr0   rH   )r   r   rJ   rZ   rv   r   rB   r   s       r    rZ   z"MediaProcessorContext.update_async   sq      yy&
 22		 3 
 
 &dmmW$..QVBWXX
s   AA1A/*A1c                     dj                  d | j                  j                         D              }dj                  |      S )r\   r]   c              3   F   K   | ]  \  }}d j                  ||        ywr_   r`   rb   s      r    rf   z1MediaProcessorContext.__repr__.<locals>.<genexpr>  rg   rh   z*<Twilio.Media.V1.MediaProcessorContext {}>ri   rl   s     r    rn   zMediaProcessorContext.__repr__  s6     ((SDNN<P<P<RSS;BB7KKr   )r   r   r   r   rp   r>   r   rO   rR   rV   rZ   rn   rr   rs   s   @r    rI   rI      sq    F Fc F
- 
&
#9 
&Y;Y	Y0Y;Y	Y0L# Lr   rI   c                   2    e Zd Zdeeef   defdZdefdZy)MediaProcessorPager/   rF   c                 .    t        | j                  |      S )zt
        Build an instance of MediaProcessorInstance

        :param payload: Payload response from the API
        )r   rJ   r|   s     r    get_instancezMediaProcessorPage.get_instance  s     &dmmW==r   c                      y)r\   z$<Twilio.Media.V1.MediaProcessorPage>r   rK   s    r    rn   zMediaProcessorPage.__repr__       6r   N)	r   r   r   r   rp   r   r   r   rn   r   r   r    r   r     s*    >DcN >7M >6# 6r   r   c                       e Zd Zdef fdZej                  ej                  ej                  ej                  fdededee	e	f   deee	f   deee	f   dee
e	f   d	efd
Zej                  ej                  ej                  ej                  fdededee	e	f   deee	f   deee	f   dee
e	f   d	efdZej                  ej                  ddfdede	f   dede	f   dee
   dee
   d	ee   f
dZej                  ej                  ddfdede	f   dede	f   dee
   dee
   d	ee   f
dZej                  ej                  ddfdede	f   dede	f   dee
   dee
   d	ee   f
dZej                  ej                  ddfdede	f   dede	f   dee
   dee
   d	ee   f
dZej                  ej                  ej                  ej                  ej                  fdede	f   dede	f   deee	f   dee
e	f   dee
e	f   d	efdZej                  ej                  ej                  ej                  ej                  fdede	f   dede	f   deee	f   dee
e	f   dee
e	f   d	efdZded	efdZded	efdZded	efdZded	efd Zd	efd!Z xZS )"MediaProcessorListr.   c                 2    t         |   |       d| _        y)zp
        Initialize the MediaProcessorList

        :param version: Version that contains the resource

        z/MediaProcessorsN)r=   r>   rv   )rD   r.   rE   s     r    r>   zMediaProcessorList.__init__  s     	!&	r   r5   r6   extension_environmentr:   r;   r<   rF   c           	          t        j                  ||t        j                  |      |||d      }| j                  j                  d| j                  |      }t        | j                  |      S )a  
        Create the MediaProcessorInstance

        :param extension: The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2`
        :param extension_context: The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send.
        :param extension_environment: User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about whether you need to provide this.
        :param status_callback: The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details.
        :param status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
        :param max_duration: The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming.

        :returns: The created MediaProcessorInstance
        	ExtensionExtensionContextExtensionEnvironmentStatusCallbackStatusCallbackMethodMaxDurationr   r   )r   r   r   ro   rJ   createrv   r   	rD   r5   r6   r   r:   r;   r<   r   r/   s	            r    r   zMediaProcessorList.create*  sp    * yy&$5(1(8(89N(O"1(>+	
 --&&		 ' 
 &dmmW==r   c           	         K   t        j                  ||t        j                  |      |||d      }| j                  j                  d| j                  |       d{   }t        | j                  |      S 7 w)a  
        Asynchronously create the MediaProcessorInstance

        :param extension: The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2`
        :param extension_context: The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send.
        :param extension_environment: User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about whether you need to provide this.
        :param status_callback: The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details.
        :param status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
        :param max_duration: The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming.

        :returns: The created MediaProcessorInstance
        r   r   r   N)r   r   r   ro   rJ   create_asyncrv   r   r   s	            r    r   zMediaProcessorList.create_asyncR  s~     * yy&$5(1(8(89N(O"1(>+	
 22		 3 
 
 &dmmW==
s   AA:A8A:Norderr   r7   r#   limit	page_sizec                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )a  
        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 &quot;MediaProcessorInstance.Order&quot; order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
        :param &quot;MediaProcessorInstance.Status&quot; status: Status to filter by, with possible values `started`, `ended` or `failed`.
        :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
        r   r   r7   r   r   )rJ   read_limitspagestreamrD   r   r7   r   r   limitsr   s          r    r   zMediaProcessorList.streamz  sN    0 **5)<yyuVvk?RyS}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously 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 &quot;MediaProcessorInstance.Order&quot; order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
        :param &quot;MediaProcessorInstance.Status&quot; status: Status to filter by, with possible values `started`, `ended` or `failed`.
        :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
        r   r   Nr   )rJ   r   
page_asyncstream_asyncr   s          r    r   zMediaProcessorList.stream_async  sd     0 **5)<__&2E % 
 
 }}))$w@@	
s   7AA$Ac                 >    t        | j                  ||||            S )aF  
        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 &quot;MediaProcessorInstance.Order&quot; order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
        :param &quot;MediaProcessorInstance.Status&quot; status: Status to filter by, with possible values `started`, `ended` or `failed`.
        :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
        r   r7   r   r   )listr   )rD   r   r7   r   r   s        r    r   zMediaProcessorList.list  s.    . KK#	  
 	
r   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)aU  
        Asynchronously 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 &quot;MediaProcessorInstance.Order&quot; order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
        :param &quot;MediaProcessorInstance.Status&quot; status: Status to filter by, with possible values `started`, `ended` or `failed`.
        :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
        r   N)r   )rD   r   r7   r   r   records         r    
list_asynczMediaProcessorList.list_async  sZ     2 '+&7&7#	 '8 ' !
 
 !
 
 	
 
s0   =0=842
48=48=
page_tokenpage_numberc                     t        j                  |||||d      }| j                  j                  d| j                  |      }t        | j                  |      S )as  
        Retrieve a single page of MediaProcessorInstance records from the API.
        Request is executed immediately

        :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
        :param status: Status to filter by, with possible values `started`, `ended` or `failed`.
        :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 MediaProcessorInstance
        r!   r*   	PageTokenr   PageSizerx   rz   r{   params)r   r   rJ   r   rv   r   rD   r   r7   r   r   r   r   responses           r    r   zMediaProcessorList.page  sX    ( yy '#%
 ==%%U		$%O!$--::r   c                    K   t        j                  |||||d      }| j                  j                  d| j                  |       d{   }t        | j                  |      S 7 w)a  
        Asynchronously retrieve a single page of MediaProcessorInstance records from the API.
        Request is executed immediately

        :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default.
        :param status: Status to filter by, with possible values `started`, `ended` or `failed`.
        :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 MediaProcessorInstance
        r   rx   r   N)r   r   rJ   r   rv   r   r   s           r    r   zMediaProcessorList.page_async  sm     ( yy '#%
 11dii 2 
 
 "$--::
s   AA&	A$
A&
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )a  
        Retrieve a specific page of MediaProcessorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MediaProcessorInstance
        rx   )rJ   domaintwiliorequestr   rD   r   r   s      r    get_pagezMediaProcessorList.get_page;  s7     ==''..66ujI!$--::r   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a  
        Asynchronously retrieve a specific page of MediaProcessorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MediaProcessorInstance
        rx   N)rJ   r   r   request_asyncr   r   s      r    get_page_asyncz!MediaProcessorList.get_page_asyncG  sD      --44BB5*UU!$--:: Vs   4AAAr0   c                 0    t        | j                  |      S z{
        Constructs a MediaProcessorContext

        :param sid: The SID of the MediaProcessor resource to update.
        rH   rI   rJ   rD   r0   s     r    r?   zMediaProcessorList.getS       %T]]<<r   c                 0    t        | j                  |      S r   r   r   s     r    __call__zMediaProcessorList.__call__[  r   r   c                      y)r\   z$<Twilio.Media.V1.MediaProcessorList>r   rK   s    r    rn   zMediaProcessorList.__repr__c  r   r   ) r   r   r   r   r>   r   unsetrp   r   ro   intr   r   r   r   r	   r   r
   r   r   r   r   r   r   r   r   r   rI   r?   r   rn   rr   rs   s   @r    r   r     s   	' 	' 8>||.4ll5;\\+1<<&>&> &>  %VV^4	&>
 sF{+&> !&c6k 2&> CK(&> 
 &>X 8>||.4ll5;\\+1<<&>&> &>  %VV^4	&>
 sF{+&> !&c6k 2&> CK(&> 
 &>T @F||AG##';3V;<; 5v=>; }	;
 C=; 
(	);> @F||AG##'A3V;<A 5v=>A }	A
 C=A 
-	.AB @F||AG##'
3V;<
 5v=>
 }	

 C=
 
$	%
D @F||AG##'
3V;<
 5v=>
 }	

 C=
 
$	%
F @F||AG)/*0,,(.;3V;<; 5v=>; #v+&	;
 3;'; f%; 
;F @F||AG)/*0,,(.!;3V;<!; 5v=>!; #v+&	!;
 3;'!; f%!; 
!;F
;3 
;+= 
;
;s 
;7I 
;=s =4 ==C =$9 =6# 6r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rI   r   r   r   r   r    <module>r      sj     L L L 6 6 8 : 2 ' !M- MDmLO mL`6 6$K6 K6r   