o
    Rh.                     @   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 dd
lmZ eddedG dd deeeZeddedG dd deZeddedG dd deZeddedG dd deZeddedG dd deZeddedG dd deZeddedG d d! d!eZed"dedG d#d$ d$eZed%dedG d&d' d'eZed(dedG d)d* d*eZd+S ),zlinebot.models.messages module.    )ABCMeta)with_metaclass)Emojis   )Mention)	Mentionee)Base)
deprecated)LineBotSdkDeprecatedIn30zUse 'from linebot.v3.webhooks import MessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.z3.0.0)reasonversioncategoryc                       s*   e Zd ZdZd fdd	Zdd Z  ZS )	MessagezAbstract Base Class of Message.NFc                    s6   t t| jdi | |r| j| d| _|| _dS )z__init__ method.

        :param str id: Message ID
        :param bool use_raw_message: Using original Message key as attribute
        :param kwargs:
        N )superr   __init____dict__updatetypeid)selfr   use_raw_messagekwargs	__class__r   Y/home/air/sanwanet/backup_V2/venv/lib/python3.10/site-packages/linebot/models/messages.pyr   &   s
   
zMessage.__init__c                 C   s   | j |dS )zA__getitem__ method.

        :param str key: Message key
        N)r   get)r   keyr   r   r   __getitem__5   s   zMessage.__getitem__)NF)__name__
__module____qualname____doc__r   r   __classcell__r   r   r   r   r   "   s    r   zUse 'from linebot.v3.webhooks import TextMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       "   e Zd ZdZd fdd	Z  ZS )TextMessagezTextMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-text

    Message object which contains the text sent from the source.
    Nc                    s   t t| jdd|i| d| _|| _|r-g }|D ]}| |t}|r(|| q|| _n|| _|rT| |t	}	g }
|	j
D ]}| |t}|rL|
| q=t	|
| _dS || _dS )z__init__ method.

        :param str id: Message ID
        :param str text: Message text
        :param List emojis: Array of LINE emoji objects
        :param object mention: LINE mention object
        :param kwargs:
        r   textNr   )r   r%   r   r   r&   get_or_new_from_json_dictr   appendemojisr   
mentioneesr   mention)r   r   r&   r)   r+   r   
new_emojisemojiemoji_objectmention_objectr*   	mentioneementionee_objectr   r   r   r   F   s8   	



zTextMessage.__init__)NNNNr   r    r!   r"   r   r#   r   r   r   r   r%   =   s    r%   zUse 'from linebot.v3.webhooks import ImageMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       r$   )ImageMessagezImageMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-image

    Message object which contains the image content sent from the source.
    The binary image data can be retrieved with the Content API.
    Nc                    s@   t t| jdd|i| d| _| |t| _| |t| _dS )ag  __init__ method.

        :param str id: Message ID
        :param content_provider: ContentProvider object
        :type content_provider:
            :py:class:`linebot.models.messages.ContentProvider`
        :param image_set: ImageSet object
        :type image_set:
            :py:class:`linebot.models.messages.ImageSet`
        :param kwargs:
        r   imageNr   )	r   r3   r   r   r'   ContentProvidercontent_providerImageSet	image_set)r   r   r6   r8   r   r   r   r   r   y   s   
zImageMessage.__init__NNNr2   r   r   r   r   r3   o       r3   zUse 'from linebot.v3.webhooks import VideoMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       r$   )VideoMessagezVideoMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-video

    Message object which contains the video content sent from the source.
    The binary video data can be retrieved with the Content API.
    Nc                    8   t t| jdd|i| d| _|| _| |t| _dS )a-  __init__ method.

        :param str id: Message ID
        :param long duration: Length of video file (milliseconds)
        :param content_provider: ContentProvider object
        :type content_provider:
            :py:class:`linebot.models.messages.ContentProvider`
        :param kwargs:
        r   videoNr   )r   r;   r   r   durationr'   r5   r6   r   r   r>   r6   r   r   r   r   r         

zVideoMessage.__init__r9   r2   r   r   r   r   r;      r:   r;   zUse 'from linebot.v3.webhooks import AudioMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       r$   )AudioMessagezAudioMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-audio

    Message object which contains the audio content sent from the source.
    The binary audio data can be retrieved with the Content API.
    Nc                    r<   )a-  __init__ method.

        :param str id: Message ID
        :param long duration: Length of audio file (milliseconds)
        :param content_provider: ContentProvider object
        :type content_provider:
            :py:class:`linebot.models.messages.ContentProvider`
        :param kwargs:
        r   audioNr   )r   rA   r   r   r>   r'   r5   r6   r?   r   r   r   r      r@   zAudioMessage.__init__r9   r2   r   r   r   r   rA      r:   rA   zUse 'from linebot.v3.webhooks import LocationMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       r$   )LocationMessagez^LocationMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-location
    Nc                    s<   t t| jdd|i| d| _|| _|| _|| _|| _dS )z__init__ method.

        :param str id: Message ID
        :param str title: Title
        :param str address: Address
        :param float latitude: Latitude
        :param float longitude: Longitude
        :param kwargs:
        r   locationNr   )r   rC   r   r   titleaddresslatitude	longitude)r   r   rE   rF   rG   rH   r   r   r   r   r      s   
zLocationMessage.__init__)NNNNNr2   r   r   r   r   rC      s    rC   zUse 'from linebot.v3.webhooks import StickerMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       s&   e Zd ZdZ		d fdd	Z  ZS )StickerMessagezStickerMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-sticker

    Message object which contains the sticker data sent from the source.
    For a list of basic LINE stickers and sticker IDs, see sticker list.
    Nc                    sB   t t| jdd|i| d| _|| _|| _|| _|| _|| _dS )aq  __init__ method.

        :param str id: Message ID
        :param str package_id: Package ID
        :param str sticker_id: Sticker ID
        :param str sticker_resource_type: Sticker resource type
        :param list[str] keywords: List of up to 15 keywords describing the sticker
        :param str text: Any text entered by the user
        :param kwargs:
        r   stickerNr   )	r   rI   r   r   
package_id
sticker_idsticker_resource_typekeywordsr&   )r   r   rK   rL   rM   rN   r&   r   r   r   r   r      s   
zStickerMessage.__init__)NNNNNNr2   r   r   r   r   rI      s
    rI   zUse 'from linebot.v3.webhooks import FileMessageContent' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       r$   )FileMessagezFileMessage.

    https://developers.line.biz/en/reference/messaging-api/#wh-file

    Message object which contains the file content sent from the source.
    The binary file data can be retrieved with the Content API.
    Nc                    s0   t t| jdd|i| d| _|| _|| _dS )z__init__ method.

        :param str id: Message ID
        :param str file_name: File Name
        :param int file_size: File Size
        :param kwargs:
        r   fileNr   )r   rO   r   r   	file_size	file_name)r   r   rR   rQ   r   r   r   r   r     s   
zFileMessage.__init__r9   r2   r   r   r   r   rO     r:   rO   zUse 'from linebot.v3.webhooks import ContentProvider' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       r$   )r5   zContent provider.Nc                    ,   t t| jdi | || _|| _|| _dS )z__init__ method.

        :param str type: Provider of the content. `line` or `external`.
        :param str original_content_url: URL of the content.
        :param str preview_image_url: URL of the preview image.
        :param kwargs:
        Nr   )r   r5   r   r   original_content_urlpreview_image_url)r   r   rT   rU   r   r   r   r   r   "     
zContentProvider.__init__r9   r2   r   r   r   r   r5         r5   zUse 'from linebot.v3.webhooks import ImageSet' instead. See https://github.com/line/line-bot-sdk-python/blob/master/README.rst for more details.c                       s"   e Zd ZdZd fdd	Z  ZS )r7   z
Image Set.Nr   c                    rS   )z__init__ method.

        :param str id: Image set ID.
        :param int index: Image number in a set of images sent simultaneously.
        :param int total: Total number of images sent simultaneously.
        :param kwargs:
        Nr   )r   r7   r   r   indextotal)r   r   rX   rY   r   r   r   r   r   5  rV   zImageSet.__init__)NNr   r2   r   r   r   r   r7   1  rW   r7   N)r"   abcr   future.utilsr   linebot.models.emojisr   r+   r   r0   r   baser   r	   linebot.deprecationsr
   r   r%   r3   r;   rA   rC   rI   rO   r5   r7   r   r   r   r   <module>   s:   1 