webhook-line 1.0.1

Webhook event definition of the LINE Messaging API
Documentation
/*
 * Webhook Type Definition
 *
 * Webhook event definition of the LINE Messaging API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TextMessageContent {
    /// Type
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    /// Message ID
    #[serde(rename = "id")]
    pub id: String,
    /// Message text.
    #[serde(rename = "text")]
    pub text: String,
    /// Array of one or more LINE emoji objects. Only included in the message event when the text property contains a LINE emoji.
    #[serde(rename = "emojis", skip_serializing_if = "Option::is_none")]
    pub emojis: Option<Vec<models::Emoji>>,
    #[serde(rename = "mention", skip_serializing_if = "Option::is_none")]
    pub mention: Option<Box<models::Mention>>,
    /// Quote token to quote this message.
    #[serde(rename = "quoteToken")]
    pub quote_token: String,
    /// Message ID of a quoted message. Only included when the received message quotes a past message.
    #[serde(rename = "quotedMessageId", skip_serializing_if = "Option::is_none")]
    pub quoted_message_id: Option<String>,
}

impl TextMessageContent {
    pub fn new(
        r#type: String,
        id: String,
        text: String,
        quote_token: String,
    ) -> TextMessageContent {
        TextMessageContent {
            r#type: Some(r#type),
            id,
            text,
            emojis: None,
            mention: None,
            quote_token,
            quoted_message_id: None,
        }
    }
}