webhook_line/models/
sticker_message_content.rs

1/*
2 * Webhook Type Definition
3 *
4 * Webhook event definition of the LINE Messaging API
5 *
6 * The version of the OpenAPI document: 1.0.0
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 StickerMessageContent {
16    /// Type
17    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
18    pub r#type: Option<String>,
19    /// Message ID
20    #[serde(rename = "id")]
21    pub id: String,
22    /// Package ID
23    #[serde(rename = "packageId")]
24    pub package_id: String,
25    /// Sticker ID
26    #[serde(rename = "stickerId")]
27    pub sticker_id: String,
28    #[serde(rename = "stickerResourceType")]
29    pub sticker_resource_type: StickerResourceType,
30    /// Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker.
31    #[serde(rename = "keywords", skip_serializing_if = "Option::is_none")]
32    pub keywords: Option<Vec<String>>,
33    /// Any text entered by the user. This property is only included for message stickers. Max character limit: 100
34    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
35    pub text: Option<String>,
36    /// Quote token to quote this message.
37    #[serde(rename = "quoteToken")]
38    pub quote_token: String,
39    /// Message ID of a quoted message. Only included when the received message quotes a past message.
40    #[serde(rename = "quotedMessageId", skip_serializing_if = "Option::is_none")]
41    pub quoted_message_id: Option<String>,
42}
43
44impl StickerMessageContent {
45    pub fn new(
46        r#type: String,
47        id: String,
48        package_id: String,
49        sticker_id: String,
50        sticker_resource_type: StickerResourceType,
51        quote_token: String,
52    ) -> StickerMessageContent {
53        StickerMessageContent {
54            r#type: Some(r#type),
55            id,
56            package_id,
57            sticker_id,
58            sticker_resource_type,
59            keywords: None,
60            text: None,
61            quote_token,
62            quoted_message_id: None,
63        }
64    }
65}
66///
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum StickerResourceType {
69    #[serde(rename = "STATIC")]
70    Static,
71    #[serde(rename = "ANIMATION")]
72    Animation,
73    #[serde(rename = "SOUND")]
74    Sound,
75    #[serde(rename = "ANIMATION_SOUND")]
76    AnimationSound,
77    #[serde(rename = "POPUP")]
78    Popup,
79    #[serde(rename = "POPUP_SOUND")]
80    PopupSound,
81    #[serde(rename = "CUSTOM")]
82    Custom,
83    #[serde(rename = "MESSAGE")]
84    Message,
85    #[serde(rename = "NAME_TEXT")]
86    NameText,
87    #[serde(rename = "PER_STICKER_TEXT")]
88    PerStickerText,
89}
90
91impl Default for StickerResourceType {
92    fn default() -> StickerResourceType {
93        Self::Static
94    }
95}