webhook_line/models/user_mentionee.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/// UserMentionee : Mentioned target is user
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UserMentionee {
17 /// Mentioned target.
18 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19 pub r#type: Option<String>,
20 /// Index position of the user mention for a character in text, with the first character being at position 0.
21 #[serde(rename = "index")]
22 pub index: i32,
23 /// The length of the text of the mentioned user. For a mention @example, 8 is the length.
24 #[serde(rename = "length")]
25 pub length: i32,
26 /// User ID of the mentioned user. Only included if mention.mentions[].type is user and the user consents to the LINE Official Account obtaining their user profile information.
27 #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
28 pub user_id: Option<String>,
29 /// Whether the mentioned user is the bot that receives the webhook.
30 #[serde(rename = "isSelf", skip_serializing_if = "Option::is_none")]
31 pub is_self: Option<bool>,
32}
33
34impl UserMentionee {
35 /// Mentioned target is user
36 pub fn new(r#type: String, index: i32, length: i32) -> UserMentionee {
37 UserMentionee {
38 r#type: Some(r#type),
39 index,
40 length,
41 user_id: None,
42 is_self: None,
43 }
44 }
45}