messaging_api_line/models/
buttons_template.rs

1/*
2 * LINE Messaging API
3 *
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ButtonsTemplate {
16    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
17    pub r#type: Option<String>,
18    #[serde(rename = "thumbnailImageUrl", skip_serializing_if = "Option::is_none")]
19    pub thumbnail_image_url: Option<String>,
20    #[serde(rename = "imageAspectRatio", skip_serializing_if = "Option::is_none")]
21    pub image_aspect_ratio: Option<String>,
22    #[serde(rename = "imageSize", skip_serializing_if = "Option::is_none")]
23    pub image_size: Option<String>,
24    #[serde(
25        rename = "imageBackgroundColor",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub image_background_color: Option<String>,
29    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
30    pub title: Option<String>,
31    #[serde(rename = "text")]
32    pub text: String,
33    #[serde(rename = "defaultAction", skip_serializing_if = "Option::is_none")]
34    pub default_action: Option<Box<models::Action>>,
35    #[serde(rename = "actions")]
36    pub actions: Vec<models::Action>,
37}
38
39impl ButtonsTemplate {
40    pub fn new(r#type: String, text: String, actions: Vec<models::Action>) -> ButtonsTemplate {
41        ButtonsTemplate {
42            r#type: Some(r#type),
43            thumbnail_image_url: None,
44            image_aspect_ratio: None,
45            image_size: None,
46            image_background_color: None,
47            title: None,
48            text,
49            default_action: None,
50            actions,
51        }
52    }
53}