o
    Ú\h½$  ã                   @   sè   d Z ddlmZ ddlmZ ddlmZ dd„ Zdd	„ ZG d
d„ deeeƒƒZ	G dd„ de	ƒZ
G dd„ de	ƒZG dd„ de	ƒZG dd„ deeeƒƒ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G dd„ de	ƒZdS )zlinebot.models.actions module.é    )ÚABCMeta)Úwith_metaclassé   )ÚBasec                 C   s"   t  | tttttttt	dœ¡}|S )zGet action.)ÚpostbackÚmessageÚuriÚdatetimepickerÚcameraÚ
cameraRollÚlocationÚrichmenuswitch)
r   Ú$get_or_new_from_json_dict_with_typesÚPostbackActionÚMessageActionÚ	URIActionÚDatetimePickerActionÚCameraActionÚCameraRollActionÚLocationActionÚRichMenuSwitchAction)ÚactionÚ
action_obj© r   úY/home/air/segue/gemini/backup/venv/lib/python3.10/site-packages/linebot/models/actions.pyÚ
get_action   s   øÿr   c                 C   s,   g }| r| D ]}t |ƒ}|r| |¡ q|S )zGet actions.)r   Úappend)ÚactionsÚnew_actionsr   r   r   r   r   Úget_actions*   s   
€r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚActionzAbstract base class of Action.c                    s    t t| ƒjdi |¤Ž d| _dS )z1__init__ method.

        :param kwargs:
        Nr   )Úsuperr    Ú__init__Útype)ÚselfÚkwargs©Ú	__class__r   r   r"   9   s   
zAction.__init__©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r"   Ú__classcell__r   r   r&   r   r    6   s    r    c                       s.   e Zd ZdZ						d‡ fdd„	Z‡  ZS )r   zýPostbackAction.

    https://developers.line.me/en/docs/messaging-api/reference/#postback-action

    When a control associated with this action is tapped,
    a postback event is returned via webhook with the specified string in the data property.
    Nc                    óD   t t| ƒjdi |¤Ž d| _|| _|| _|| _|| _|| _|| _	dS )a  __init__ method.

        :param str label: Label for the action.
        :param str data: String returned via webhook
            in the postback.data property of the postback event.
        :param str display_text: Text displayed in the chat as a message sent by
            the user when the action is performed.
        :param str text: Deprecated. Text displayed in the chat as a message sent by
            the user when the action is performed. Returned from the server through a webhook.
        :param kwargs:
        r   Nr   )
r!   r   r"   r#   ÚlabelÚdataÚdisplay_textÚtextÚinput_optionÚfill_in_text)r$   r/   r0   r1   r2   r3   r4   r%   r&   r   r   r"   L   s   
zPostbackAction.__init__©NNNNNNr(   r   r   r&   r   r   C   s    
ùr   c                       ó"   e Zd ZdZd‡ fdd„	Z‡  ZS )r   zæMessageAction.

    https://developers.line.me/en/docs/messaging-api/reference/#message-action

    When a control associated with this action is tapped,
    the string in the text property is sent as a message from the user.
    Nc                    s,   t t| ƒjdi |¤Ž d| _|| _|| _dS )z¢__init__ method.

        :param str label: Label for the action.
        :param str text: Text sent when the action is performed.
        :param kwargs:
        r   Nr   )r!   r   r"   r#   r/   r2   )r$   r/   r2   r%   r&   r   r   r"   u   s   
zMessageAction.__init__)NNr(   r   r   r&   r   r   l   ó    r   c                       r6   )r   zËURIAction.

    https://developers.line.me/en/docs/messaging-api/reference/#uri-action

    When a control associated with this action is tapped,
    the URI specified in the uri property is opened.
    Nc                    s:   t t| ƒjdi |¤Ž d| _|| _|| _|  |t¡| _dS )a?  __init__ method.

        :param str label: Label for the action
            Max: 20 characters
        :param str uri: URI opened when the action is performed.
        :param alt_uri: URI opened when the desktop app.
        :type alt_uri: T <= :py:class:`linebot.models.actions.AltUri`
        :param kwargs:
        r   Nr   )	r!   r   r"   r#   r/   r   Úget_or_new_from_json_dictÚAltUriÚalt_uri)r$   r/   r   r:   r%   r&   r   r   r"   Œ   s
   
zURIAction.__init__©NNNr(   r   r   r&   r   r   ƒ   r7   r   c                       r6   )r9   znAltUri.

    https://github.com/line/line-bot-sdk-python/issues/155

    URI opened when the desktop app.
    Nc                    s    t t| ƒjdi |¤Ž || _dS )a  __init__ method.

        :param str desktop: URI opened on LINE for macOS and Windows
            when the action is performed.
            If the altUri.desktop property is set,
            the uri property is ignored on LINE for macOS and Windows.
        :param kwargs:
        Nr   )r!   r9   r"   Údesktop)r$   r<   r%   r&   r   r   r"   ¦   s   	
zAltUri.__init__©Nr(   r   r   r&   r   r9   ž   s    r9   c                       s&   e Zd ZdZ		d‡ fdd„	Z‡  ZS )r   ao  DatetimePickerAction.

    https://developers.line.me/en/docs/messaging-api/reference/#datetime-picker-action

    When a control associated with this action is tapped,
    a postback event is returned via webhook with the date and time
    selected by the user from the date and time selection dialog.
    The datetime picker action does not support time zones.
    Nc                    r.   )a…  __init__ method.

        :param str label: Label for the action
        :param str data: String returned via webhook
            in the postback.data property of the postback event
        :param str mode: Action mode
            date: Pick date
            time: Pick time
            datetime: Pick date and time
        :param str initial: Initial value of date or time
        :param str max: Largest date or time value that can be selected.
            Must be greater than the min value.
        :param str min: Smallest date or time value that can be selected.
            Must be less than the max value.
        :param kwargs:
        r	   Nr   )
r!   r   r"   r#   r/   r0   ÚmodeÚinitialÚmaxÚmin)r$   r/   r0   r>   r?   r@   rA   r%   r&   r   r   r"   ¿   s   
zDatetimePickerAction.__init__r5   r(   r   r   r&   r   r   ´   s
    
ÿr   c                       r6   )r   a  CameraAction.

    https://developers.line.me/en/reference/messaging-api/#camera-action

    This action can be configured only with quick reply buttons.
    When a button associated with this action is tapped,
    the camera screen in the LINE app is opened.
    Nc                    ó&   t t| ƒjdi |¤Ž d| _|| _dS )ú`__init__ method.

        :param str label: Label for the action
        :param kwargs:
        r
   Nr   )r!   r   r"   r#   r/   ©r$   r/   r%   r&   r   r   r"   æ   ó   
zCameraAction.__init__r=   r(   r   r   r&   r   r   Ü   ó    	r   c                       r6   )r   a  CameraRollAction.

    https://developers.line.me/en/reference/messaging-api/#camera-roll-action

    This action can be configured only with quick reply buttons.
    When a button associated with this action is tapped,
    the camera roll screen in the LINE app is opened.
    Nc                    rB   )rC   r   Nr   )r!   r   r"   r#   r/   rD   r&   r   r   r"   ü   rE   zCameraRollAction.__init__r=   r(   r   r   r&   r   r   ò   rF   r   c                       r6   )r   a  LocationRollAction.

    https://developers.line.me/en/reference/messaging-api/#location-action

    This action can be configured only with quick reply buttons.
    When a button associated with this action is tapped,
    the location screen in the LINE app is opened.
    Nc                    rB   )rC   r   Nr   )r!   r   r"   r#   r/   rD   r&   r   r   r"     rE   zLocationAction.__init__r=   r(   r   r   r&   r   r     rF   r   c                       r6   )r   a°  RichMenuSwitchAction.

    https://developers.line.biz/en/reference/messaging-api/#richmenu-switch-action

    This action can be configured only with rich menus.
    It can't be used for Flex Messages or quick replies.
    When you tap a rich menu associated with this action,
    you can switch between rich menus,
    and a postback event including the rich menu alias ID selected
     by the user is returned via a webhook.
    Nc                    s2   t t| ƒjdi |¤Ž d| _|| _|| _|| _dS )a  __init__ method.

        :param str label: Label for the action
        :param str rich_menu_alias_id: Rich menu alias ID to switch to.
        :param str data: String returned by the postback.data property
         of the postback event via a webhook
        :param kwargs:
        r   Nr   )r!   r   r"   r#   r/   Úrich_menu_alias_idr0   )r$   r/   rG   r0   r%   r&   r   r   r"   +  s
   	
zRichMenuSwitchAction.__init__r;   r(   r   r   r&   r   r     s    r   N)r,   Úabcr   Úfuture.utilsr   Úbaser   r   r   r    r   r   r   r9   r   r   r   r   r   r   r   r   r   Ú<module>   s    )(