1 use crate::sensitive::Sensitive;
2 use lemmy_db_schema::newtypes::CustomEmojiId;
3 use lemmy_db_views::structs::CustomEmojiView;
4 use serde::{Deserialize, Serialize};
5 #[cfg(feature = "full")]
9 #[derive(Debug, Serialize, Deserialize, Clone)]
10 #[cfg_attr(feature = "full", derive(TS))]
11 #[cfg_attr(feature = "full", ts(export))]
12 /// Create a custom emoji.
13 pub struct CreateCustomEmoji {
15 pub shortcode: String,
16 #[cfg_attr(feature = "full", ts(type = "string"))]
19 pub keywords: Vec<String>,
20 pub auth: Sensitive<String>,
23 #[derive(Debug, Serialize, Deserialize, Clone)]
24 #[cfg_attr(feature = "full", derive(TS))]
25 #[cfg_attr(feature = "full", ts(export))]
26 /// Edit a custom emoji.
27 pub struct EditCustomEmoji {
28 pub id: CustomEmojiId,
30 #[cfg_attr(feature = "full", ts(type = "string"))]
33 pub keywords: Vec<String>,
34 pub auth: Sensitive<String>,
37 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
38 #[cfg_attr(feature = "full", derive(TS))]
39 #[cfg_attr(feature = "full", ts(export))]
40 /// Delete a custom emoji.
41 pub struct DeleteCustomEmoji {
42 pub id: CustomEmojiId,
43 pub auth: Sensitive<String>,
46 #[derive(Serialize, Deserialize, Clone)]
47 #[cfg_attr(feature = "full", derive(TS))]
48 #[cfg_attr(feature = "full", ts(export))]
49 /// The response for deleting a custom emoji.
50 pub struct DeleteCustomEmojiResponse {
51 pub id: CustomEmojiId,
55 #[derive(Debug, Serialize, Deserialize, Clone)]
56 #[cfg_attr(feature = "full", derive(TS))]
57 #[cfg_attr(feature = "full", ts(export))]
58 /// A response for a custom emoji.
59 pub struct CustomEmojiResponse {
60 pub custom_emoji: CustomEmojiView,