messaging-api-line 0.0.2

This document describes LINE Messaging API.
Documentation
/*
 * LINE Messaging API
 *
 * This document describes LINE Messaging API.
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ButtonsTemplate {
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "thumbnailImageUrl", skip_serializing_if = "Option::is_none")]
    pub thumbnail_image_url: Option<String>,
    #[serde(rename = "imageAspectRatio", skip_serializing_if = "Option::is_none")]
    pub image_aspect_ratio: Option<String>,
    #[serde(rename = "imageSize", skip_serializing_if = "Option::is_none")]
    pub image_size: Option<String>,
    #[serde(
        rename = "imageBackgroundColor",
        skip_serializing_if = "Option::is_none"
    )]
    pub image_background_color: Option<String>,
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    #[serde(rename = "text")]
    pub text: String,
    #[serde(rename = "defaultAction", skip_serializing_if = "Option::is_none")]
    pub default_action: Option<Box<models::Action>>,
    #[serde(rename = "actions")]
    pub actions: Vec<models::Action>,
}

impl ButtonsTemplate {
    pub fn new(r#type: String, text: String, actions: Vec<models::Action>) -> ButtonsTemplate {
        ButtonsTemplate {
            r#type: Some(r#type),
            thumbnail_image_url: None,
            image_aspect_ratio: None,
            image_size: None,
            image_background_color: None,
            title: None,
            text,
            default_action: None,
            actions,
        }
    }
}