line_messaging_api/models/
postback_action.rs

1/*
2* Copyright (C) 2016 LINE Corp.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8*     http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17/*
18 * LINE Messaging API
19 *
20 * This document describes LINE Messaging API.
21 *
22 * The version of the OpenAPI document: 0.0.3
23 *
24 * Generated by: https://openapi-generator.tech
25 */
26
27#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
28pub struct PostbackAction {
29    /// Type of action
30    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
31    pub r#type: Option<String>,
32    /// Label for the action.
33    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
34    pub label: Option<String>,
35    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
36    pub data: Option<String>,
37    #[serde(rename = "displayText", skip_serializing_if = "Option::is_none")]
38    pub display_text: Option<String>,
39    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
40    pub text: Option<String>,
41    #[serde(rename = "inputOption", skip_serializing_if = "Option::is_none")]
42    pub input_option: Option<InputOption>,
43    #[serde(rename = "fillInText", skip_serializing_if = "Option::is_none")]
44    pub fill_in_text: Option<String>,
45}
46
47impl PostbackAction {
48    pub fn new() -> PostbackAction {
49        PostbackAction {
50            r#type: None,
51            label: None,
52            data: None,
53            display_text: None,
54            text: None,
55            input_option: None,
56            fill_in_text: None,
57        }
58    }
59}
60
61///
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum InputOption {
64    #[serde(rename = "closeRichMenu")]
65    CloseRichMenu,
66    #[serde(rename = "openRichMenu")]
67    OpenRichMenu,
68    #[serde(rename = "openKeyboard")]
69    OpenKeyboard,
70    #[serde(rename = "openVoice")]
71    OpenVoice,
72}
73
74impl Default for InputOption {
75    fn default() -> InputOption {
76        Self::CloseRichMenu
77    }
78}