o
    �¨ÊhH9  ã                   @   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ddfdd„Zejejejddfdd„Z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dd„ Z‡  ZS )Ú	MediaListú  c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a�  
        Initialize the MediaList

        :param Version version: Version that contains the resource
        :param account_sid: The unique sid that identifies this account
        :param message_sid: A string that uniquely identifies this message

        :returns: twilio.rest.api.v2010.account.message.media.MediaList
        :rtype: twilio.rest.api.v2010.account.message.media.MediaList
        ©Úaccount_sidÚmessage_sidz9/Accounts/{account_sid}/Messages/{message_sid}/Media.jsonN© )Úsuperr	   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   r   ©Ú	__class__r   ú]/var/www/html/env/lib/python3.10/site-packages/twilio/rest/api/v2010/account/message/media.pyr      s   zMediaList.__init__Nc                 C   s<   | j  ||¡}| j||||d d�}| j  ||d |d ¡S )a‡  
        Streams MediaInstance 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 datetime date_created_before: Filter by date created
        :param datetime date_created: Filter by date created
        :param datetime date_created_after: Filter by date created
        :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.api.v2010.account.message.media.MediaInstance]
        Ú	page_size)Údate_created_beforeÚdate_createdÚdate_created_afterr   ÚlimitÚ
page_limit)Ú_versionÚread_limitsÚpageÚstream)r   r   r   r   r   r   Úlimitsr!   r   r   r   r"   &   s   üzMediaList.streamc                 C   s   t | j|||||d�ƒS )a'  
        Lists MediaInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param datetime date_created_before: Filter by date created
        :param datetime date_created: Filter by date created
        :param datetime date_created_after: Filter by date created
        :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.api.v2010.account.message.media.MediaInstance]
        )r   r   r   r   r   )Úlistr"   )r   r   r   r   r   r   r   r   r   r$   F   s   ûzMediaList.listc           	   	   C   sN   t  t |¡t |¡t |¡|||dœ¡}| jjd| j|d�}t| j|| jƒS )a…  
        Retrieve a single page of MediaInstance records from the API.
        Request is executed immediately

        :param datetime date_created_before: Filter by date created
        :param datetime date_created: Filter by date created
        :param datetime date_created_after: Filter by date created
        :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 MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaPage
        )zDateCreated<ÚDateCreatedzDateCreated>Ú	PageTokenr   ÚPageSizeÚGET©Úparams)	r   Úofr   Úiso8601_datetimer   r!   r   Ú	MediaPager   )	r   r   r   r   Ú
page_tokenÚpage_numberr   r*   Úresponser   r   r   r!   b   s   ú	ýzMediaList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a9  
        Retrieve a specific page of MediaInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaPage
        r(   )r   ÚdomainÚtwilioÚrequestr-   r   )r   Ú
target_urlr0   r   r   r   Úget_page„   s
   

þzMediaList.get_pagec                 C   ó   t | j| jd | jd |d�S ©zï
        Constructs a MediaContext

        :param sid: Fetch by unique media Sid

        :returns: twilio.rest.api.v2010.account.message.media.MediaContext
        :rtype: twilio.rest.api.v2010.account.message.media.MediaContext
        r   r   ©r   r   Úsid©ÚMediaContextr   r   ©r   r9   r   r   r   Úget•   ó   	üzMediaList.getc                 C   r6   r7   r:   r<   r   r   r   Ú__call__¥   r>   zMediaList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.MediaList>r   ©r   r   r   r   Ú__repr__µ   ó   zMediaList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr"   r$   r!   r5   r=   r?   rC   Ú__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-   r
   c                    s   t t| ƒ ||¡ || _dS )aÈ  
        Initialize the MediaPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The unique sid that identifies this account
        :param message_sid: A string that uniquely identifies this message

        :returns: twilio.rest.api.v2010.account.message.media.MediaPage
        :rtype: twilio.rest.api.v2010.account.message.media.MediaPage
        N)r   r-   r   r   )r   r   r0   Úsolutionr   r   r   r   Â   s   
zMediaPage.__init__c                 C   s   t | j|| jd | jd d�S )a  
        Build an instance of MediaInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.message.media.MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaInstance
        r   r   r   )ÚMediaInstancer   r   )r   Úpayloadr   r   r   Úget_instanceÓ   s   	üzMediaPage.get_instancec                 C   r@   )rA   z<Twilio.Api.V2010.MediaPage>r   rB   r   r   r   rC   ã   rD   zMediaPage.__repr__)rE   rF   rG   rH   r   rN   rC   rJ   r   r   r   r   r-   ¿   s
    r-   c                       s8   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Z‡  ZS )
r;   r
   c                    s6   t t| ƒ |¡ |||dœ| _djdi | j¤Ž| _dS )aŒ  
        Initialize the MediaContext

        :param Version version: Version that contains the resource
        :param account_sid: The account_sid
        :param message_sid: The message_sid
        :param sid: Fetch by unique media Sid

        :returns: twilio.rest.api.v2010.account.message.media.MediaContext
        :rtype: twilio.rest.api.v2010.account.message.media.MediaContext
        r8   z?/Accounts/{account_sid}/Messages/{message_sid}/Media/{sid}.jsonNr   )r   r;   r   r   r   r   )r   r   r   r   r9   r   r   r   r   ð   s   zMediaContext.__init__c                 C   s   | j  d| j¡S )ú|
        Deletes the MediaInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rP   r   rB   r   r   r   rP     s   zMediaContext.deletec                 C   sD   t  i ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )úš
        Fetch a MediaInstance

        :returns: Fetched MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaInstance
        r(   r)   r   r   r9   r8   )r   r+   r   Úfetchr   rL   r   )r   r*   rM   r   r   r   rR     s   
ýûzMediaContext.fetchc                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rA   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>)  ó   € z(MediaContext.__repr__.<locals>.<genexpr>z"<Twilio.Api.V2010.MediaContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rC   "  ó   
zMediaContext.__repr__)	rE   rF   rG   rH   r   rP   rR   rC   rJ   r   r   r   r   r;   í   s    	r;   c                       sš   e Zd Zd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dd„ Zdd„ Zdd„ Z‡  ZS )rL   r
   Nc                    sp   t t| ƒ |¡ |d |d t |d ¡t |d ¡|d |d |d dœ| _d	| _|||p2| jd d
œ| _d	S )zÅ
        Initialize the MediaInstance

        :returns: twilio.rest.api.v2010.account.message.media.MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaInstance
        r   Úcontent_typer   Údate_updatedÚ
parent_sidr9   Úuri)r   rd   r   re   rf   r9   rg   Nr8   )r   rL   r   r   Úrfc2822_datetimeÚ_propertiesÚ_contextr   )r   r   rM   r   r   r9   r   r   r   r   0  s   ùýzMediaInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d�| _ | j S )a/  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: MediaContext for this MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaContext
        Nr   r   r9   r8   )rj   r;   r   r   rB   r   r   r   Ú_proxyL  s   
	üzMediaInstance._proxyc                 C   ó
   | j d S )z_
        :returns: The unique sid that identifies this account
        :rtype: unicode
        r   ©ri   rB   r   r   r   r   ^  ó   
zMediaInstance.account_sidc                 C   rl   )zV
        :returns: The default mime-type of the media
        :rtype: unicode
        rd   rm   rB   r   r   r   rd   f  rn   zMediaInstance.content_typec                 C   rl   )zW
        :returns: The date this resource was created
        :rtype: datetime
        r   rm   rB   r   r   r   r   n  rn   zMediaInstance.date_createdc                 C   rl   )z\
        :returns: The date this resource was last updated
        :rtype: datetime
        re   rm   rB   r   r   r   re   v  rn   zMediaInstance.date_updatedc                 C   rl   )zi
        :returns: The unique id of the resource that created the media.
        :rtype: unicode
        rf   rm   rB   r   r   r   rf   ~  rn   zMediaInstance.parent_sidc                 C   rl   )z`
        :returns: A string that uniquely identifies this media
        :rtype: unicode
        r9   rm   rB   r   r   r   r9   †  rn   zMediaInstance.sidc                 C   rl   )zM
        :returns: The URI for this resource
        :rtype: unicode
        rg   rm   rB   r   r   r   rg   Ž  rn   zMediaInstance.uric                 C   ó
   | j  ¡ S )rO   )rk   rP   rB   r   r   r   rP   –  ó   
zMediaInstance.deletec                 C   ro   )rQ   )rk   rR   rB   r   r   r   rR   Ÿ  rp   zMediaInstance.fetchc                 C   rS   )rA   rT   c                 s   rU   rV   rW   rX   r   r   r   r\   ¯  r]   z)MediaInstance.__repr__.<locals>.<genexpr>z#<Twilio.Api.V2010.MediaInstance {}>r^   ra   r   r   r   rC   ¨  rc   zMediaInstance.__repr__)N)rE   rF   rG   rH   r   Úpropertyrk   r   rd   r   re   rf   r9   rg   rP   rR   rC   rJ   r   r   r   r   rL   -  s,    







		rL   N)rH   Útwilio.baser   r   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r	   r-   r;   rL   r   r   r   r   Ú<module>   s    ..@