o
    �¨ÊhÔ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 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)Úvalues)ÚInstanceContext)ÚInstanceResource)ÚListResource)ÚPagec                       s�   e Zd ZdZ‡ fdd„Zejejfdd„Zejddfdd„Zejddfd	d
„Z	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 )ÚMessageListú  c                    s4   t t| ƒ |¡ ||dœ| _djdi | j¤Ž| _dS )a�  
        Initialize the MessageList

        :param Version version: Version that contains the resource
        :param service_sid: The unique id of the Service this message belongs to.
        :param channel_sid: The channel_sid

        :returns: twilio.rest.chat.v1.service.channel.message.MessageList
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageList
        ©Úservice_sidÚchannel_sidz7/Services/{service_sid}/Channels/{channel_sid}/MessagesN© )Úsuperr   Ú__init__Ú	_solutionÚformatÚ_uri)ÚselfÚversionr   r   ©Ú	__class__r   ú]/var/www/html/env/lib/python3.10/site-packages/twilio/rest/chat/v1/service/channel/message.pyr      s   zMessageList.__init__c                 C   sD   t  |||dœ¡}| jjd| j|d�}t| j|| jd | jd d�S )a+  
        Create a new MessageInstance

        :param unicode body: The body
        :param unicode from_: The from
        :param unicode attributes: The attributes

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageInstance
        )ÚBodyÚFromÚ
AttributesÚPOST©Údatar   r   r
   )r   ÚofÚ_versionÚcreater   ÚMessageInstancer   )r   ÚbodyÚfrom_Ú
attributesr   Úpayloadr   r   r   r    %   s   ýüzMessageList.createNc                 C   s8   | j  ||¡}| j||d d�}| j  ||d |d ¡S )a  
        Streams MessageInstance 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 MessageInstance.OrderType order: The order
        :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.chat.v1.service.channel.message.MessageInstance]
        Ú	page_size)Úorderr&   ÚlimitÚ
page_limit)r   Úread_limitsÚpageÚstream)r   r'   r(   r&   Úlimitsr+   r   r   r   r,   ?   s   zMessageList.streamc                 C   s   t | j|||d�ƒS )a¡  
        Lists MessageInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param MessageInstance.OrderType order: The order
        :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.chat.v1.service.channel.message.MessageInstance]
        )r'   r(   r&   )Úlistr,   )r   r'   r(   r&   r   r   r   r.   W   s   zMessageList.listc                 C   s8   t  ||||dœ¡}| jjd| j|d�}t| j|| jƒS )a  
        Retrieve a single page of MessageInstance records from the API.
        Request is executed immediately

        :param MessageInstance.OrderType order: The order
        :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 MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessagePage
        )ÚOrderÚ	PageTokenr   ÚPageSizeÚGET©Úparams)r   r   r   r+   r   ÚMessagePager   )r   r'   Ú
page_tokenÚpage_numberr&   r4   Úresponser   r   r   r+   j   s   üýzMessageList.pagec                 C   s"   | j jj d|¡}t| j || jƒS )a?  
        Retrieve a specific page of MessageInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessagePage
        r2   )r   ÚdomainÚtwilioÚrequestr5   r   )r   Ú
target_urlr8   r   r   r   Úget_page‡   s
   

þzMessageList.get_pagec                 C   ó   t | j| jd | jd |d�S ©zã
        Constructs a MessageContext

        :param sid: The sid

        :returns: twilio.rest.chat.v1.service.channel.message.MessageContext
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageContext
        r   r   ©r   r   Úsid©ÚMessageContextr   r   ©r   rA   r   r   r   Úget˜   ó   	üzMessageList.getc                 C   r>   r?   rB   rD   r   r   r   Ú__call__¨   rF   zMessageList.__call__c                 C   ó   dS )úz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Chat.V1.MessageList>r   ©r   r   r   r   Ú__repr__¸   ó   zMessageList.__repr__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úunsetr    r,   r.   r+   r=   rE   rG   rK   Ú__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 )r5   r	   c                    s   t t| ƒ ||¡ || _dS )a¹  
        Initialize the MessagePage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: The unique id of the Service this message belongs to.
        :param channel_sid: The channel_sid

        :returns: twilio.rest.chat.v1.service.channel.message.MessagePage
        :rtype: twilio.rest.chat.v1.service.channel.message.MessagePage
        N)r   r5   r   r   )r   r   r8   Úsolutionr   r   r   r   Å   s   
zMessagePage.__init__c                 C   s   t | j|| jd | jd d�S )a  
        Build an instance of MessageInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.chat.v1.service.channel.message.MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageInstance
        r   r   r
   )r!   r   r   )r   r%   r   r   r   Úget_instanceÖ   s   	üzMessagePage.get_instancec                 C   rH   )rI   z<Twilio.Chat.V1.MessagePage>r   rJ   r   r   r   rK   æ   rL   zMessagePage.__repr__)rM   rN   rO   rP   r   rT   rK   rR   r   r   r   r   r5   Â   s
    r5   c                       sJ   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zejejfdd	„Z	d
d„ Z
‡  ZS )rC   r	   c                    s6   t t| ƒ |¡ |||dœ| _djdi | j¤Ž| _dS )a€  
        Initialize the MessageContext

        :param Version version: Version that contains the resource
        :param service_sid: The service_sid
        :param channel_sid: The channel_sid
        :param sid: The sid

        :returns: twilio.rest.chat.v1.service.channel.message.MessageContext
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageContext
        r@   z=/Services/{service_sid}/Channels/{channel_sid}/Messages/{sid}Nr   )r   rC   r   r   r   r   )r   r   r   r   rA   r   r   r   r   ó   s   zMessageContext.__init__c                 C   sD   t  i ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )ú 
        Fetch a MessageInstance

        :returns: Fetched MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageInstance
        r2   r3   r   r   rA   r@   )r   r   r   Úfetchr   r!   r   )r   r4   r%   r   r   r   rV     s   
ýûzMessageContext.fetchc                 C   s   | j  d| j¡S )ú~
        Deletes the MessageInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        Údelete)r   rX   r   rJ   r   r   r   rX     s   zMessageContext.deletec                 C   sJ   t  ||dœ¡}| jjd| j|d�}t| j|| jd | jd | jd d�S )áK  
        Update the MessageInstance

        :param unicode body: The new message body string.
        :param unicode attributes: The new attributes metadata field you can use to store any data you wish.

        :returns: Updated MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageInstance
        )r   r   r   r   r   r   rA   r@   )r   r   r   Úupdater   r!   r   )r   r"   r$   r   r%   r   r   r   rZ   %  s   
ýûzMessageContext.updatec                 C   ó$   d  dd„ | j ¡ D ƒ¡}d |¡S )rI   ú c                 s   ó    � | ]\}}d   ||¡V  qdS ©z{}={}N©r   ©Ú.0ÚkÚvr   r   r   Ú	<genexpr>F  ó   € z*MessageContext.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V1.MessageContext {}>©Újoinr   Úitemsr   ©r   Úcontextr   r   r   rK   ?  ó   
zMessageContext.__repr__)rM   rN   rO   rP   r   rV   rX   r   rQ   rZ   rK   rR   r   r   r   r   rC   ð   s    	rC   c                       s  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d#d$„ Zd%d&„ Zejejfd'd(„Zd)d*„ Z‡  ZS ),r!   r	   c                   @   s   e Zd ZdZdZdS )zMessageInstance.OrderTypeÚascÚdescN)rM   rN   rO   ÚASCÚDESCr   r   r   r   Ú	OrderTypeM  s    rp   Nc                    sš   t t| ƒ |¡ |d |d |d |d |d |d t |d ¡t |d ¡|d	 |d
 |d t |d ¡|d dœ| _d| _|||pG| jd dœ| _dS )zË
        Initialize the MessageInstance

        :returns: twilio.rest.chat.v1.service.channel.message.MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageInstance
        rA   Úaccount_sidr$   r   Útor   Údate_createdÚdate_updatedÚ
was_editedÚfromr"   ÚindexÚurl)rA   rq   r$   r   rr   r   rs   rt   ru   r#   r"   rw   rx   Nr@   )	r   r!   r   r   Úiso8601_datetimeÚintegerÚ_propertiesÚ_contextr   )r   r   r%   r   r   rA   r   r   r   r   Q  s(   óýzMessageInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d�| _ | j S )a5  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: MessageContext for this MessageInstance
        :rtype: twilio.rest.chat.v1.service.channel.message.MessageContext
        Nr   r   rA   r@   )r|   rC   r   r   rJ   r   r   r   Ú_proxys  s   
	üzMessageInstance._proxyc                 C   ó
   | j d S )zq
        :returns: A 34 character string that uniquely identifies this resource.
        :rtype: unicode
        rA   ©r{   rJ   r   r   r   rA   …  ó   
zMessageInstance.sidc                 C   r~   )zn
        :returns: The unique id of the Account responsible for this message.
        :rtype: unicode
        rq   r   rJ   r   r   r   rq   �  r€   zMessageInstance.account_sidc                 C   r~   )z}
        :returns: An optional string metadata field you can use to store any data you wish.
        :rtype: unicode
        r$   r   rJ   r   r   r   r$   •  r€   zMessageInstance.attributesc                 C   r~   )zi
        :returns: The unique id of the Service this message belongs to.
        :rtype: unicode
        r   r   rJ   r   r   r   r   �  r€   zMessageInstance.service_sidc                 C   r~   )zj
        :returns: The unique id of the Channel this message was sent to.
        :rtype: unicode
        rr   r   rJ   r   r   r   rr   ¥  r€   zMessageInstance.toc                 C   r~   )zC
        :returns: The channel_sid
        :rtype: unicode
        r   r   rJ   r   r   r   r   ­  r€   zMessageInstance.channel_sidc                 C   r~   )z]
        :returns: The date that this resource was created.
        :rtype: datetime
        rs   r   rJ   r   r   r   rs   µ  r€   zMessageInstance.date_createdc                 C   r~   )zb
        :returns: The date that this resource was last updated.
        :rtype: datetime
        rt   r   rJ   r   r   r   rt   ½  r€   zMessageInstance.date_updatedc                 C   r~   )zk
        :returns: true if the message has been updated since it was created.
        :rtype: bool
        ru   r   rJ   r   r   r   ru   Å  r€   zMessageInstance.was_editedc                 C   r~   )zY
        :returns: The identity of the message's author.
        :rtype: unicode
        r#   r   rJ   r   r   r   r#   Í  r€   zMessageInstance.from_c                 C   r~   )zP
        :returns: The contents of the message.
        :rtype: unicode
        r"   r   rJ   r   r   r   r"   Õ  r€   zMessageInstance.bodyc                 C   r~   )z_
        :returns: The index of the message within the Channel
        :rtype: unicode
        rw   r   rJ   r   r   r   rw   Ý  r€   zMessageInstance.indexc                 C   r~   )zU
        :returns: An absolute URL for this message.
        :rtype: unicode
        rx   r   rJ   r   r   r   rx   å  r€   zMessageInstance.urlc                 C   ó
   | j  ¡ S )rU   )r}   rV   rJ   r   r   r   rV   í  ó   
zMessageInstance.fetchc                 C   r�   )rW   )r}   rX   rJ   r   r   r   rX   ö  r‚   zMessageInstance.deletec                 C   s   | j j||d�S )rY   )r"   r$   )r}   rZ   )r   r"   r$   r   r   r   rZ   ÿ  s   
zMessageInstance.updatec                 C   r[   )rI   r\   c                 s   r]   r^   r_   r`   r   r   r   rd     re   z+MessageInstance.__repr__.<locals>.<genexpr>z#<Twilio.Chat.V1.MessageInstance {}>rf   ri   r   r   r   rK     rk   zMessageInstance.__repr__)N)rM   rN   rO   rP   Úobjectrp   r   Úpropertyr}   rA   rq   r$   r   rr   r   rs   rt   ru   r#   r"   rw   rx   rV   rX   r   rQ   rZ   rK   rR   r   r   r   r   r!   J  sH    "













		r!   N)rP   Útwilio.baser   r   Útwilio.base.instance_contextr   Útwilio.base.instance_resourcer   Útwilio.base.list_resourcer   Útwilio.base.pager   r   r5   rC   r!   r   r   r   r   Ú<module>   s    2.Z