2 aggregates::structs::{CommentAggregates, PersonAggregates, PostAggregates, SiteAggregates},
5 comment_report::CommentReport,
7 custom_emoji::CustomEmoji,
8 custom_emoji_keyword::CustomEmojiKeyword,
10 local_site_rate_limit::LocalSiteRateLimit,
11 local_user::LocalUser,
14 post_report::PostReport,
15 private_message::PrivateMessage,
16 private_message_report::PrivateMessageReport,
17 registration_application::RegistrationApplication,
22 use serde::{Deserialize, Serialize};
23 use serde_with::skip_serializing_none;
24 #[cfg(feature = "full")]
27 #[skip_serializing_none]
28 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
29 #[cfg_attr(feature = "full", derive(TS))]
30 #[cfg_attr(feature = "full", ts(export))]
31 /// A comment report view.
32 pub struct CommentReportView {
33 pub comment_report: CommentReport,
36 pub community: Community,
38 pub comment_creator: Person,
39 pub counts: CommentAggregates,
40 pub creator_banned_from_community: bool,
41 pub my_vote: Option<i16>,
42 pub resolver: Option<Person>,
45 #[skip_serializing_none]
46 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
47 #[cfg_attr(feature = "full", derive(TS))]
48 #[cfg_attr(feature = "full", ts(export))]
50 pub struct CommentView {
54 pub community: Community,
55 pub counts: CommentAggregates,
56 pub creator_banned_from_community: bool,
57 pub subscribed: SubscribedType,
59 pub creator_blocked: bool,
60 pub my_vote: Option<i16>,
63 #[derive(Debug, Serialize, Deserialize, Clone)]
64 #[cfg_attr(feature = "full", derive(TS))]
65 #[cfg_attr(feature = "full", ts(export))]
66 /// A local user view.
67 pub struct LocalUserView {
68 pub local_user: LocalUser,
70 pub counts: PersonAggregates,
73 #[skip_serializing_none]
74 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
75 #[cfg_attr(feature = "full", derive(TS))]
76 #[cfg_attr(feature = "full", ts(export))]
77 /// A post report view.
78 pub struct PostReportView {
79 pub post_report: PostReport,
81 pub community: Community,
83 pub post_creator: Person,
84 pub creator_banned_from_community: bool,
85 pub my_vote: Option<i16>,
86 pub counts: PostAggregates,
87 pub resolver: Option<Person>,
90 #[skip_serializing_none]
91 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
92 #[cfg_attr(feature = "full", derive(TS))]
93 #[cfg_attr(feature = "full", ts(export))]
98 pub community: Community,
99 pub creator_banned_from_community: bool,
100 pub counts: PostAggregates,
101 pub subscribed: SubscribedType,
104 pub creator_blocked: bool,
105 pub my_vote: Option<i16>,
106 pub unread_comments: i64,
109 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
110 #[cfg_attr(feature = "full", derive(TS))]
111 #[cfg_attr(feature = "full", ts(export))]
112 /// A private message view.
113 pub struct PrivateMessageView {
114 pub private_message: PrivateMessage,
116 pub recipient: Person,
119 #[skip_serializing_none]
120 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
121 #[cfg_attr(feature = "full", derive(TS))]
122 #[cfg_attr(feature = "full", ts(export))]
123 /// A private message report view.
124 pub struct PrivateMessageReportView {
125 pub private_message_report: PrivateMessageReport,
126 pub private_message: PrivateMessage,
127 pub private_message_creator: Person,
129 pub resolver: Option<Person>,
132 #[skip_serializing_none]
133 #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
134 #[cfg_attr(feature = "full", derive(TS))]
135 #[cfg_attr(feature = "full", ts(export))]
136 /// A registration application view.
137 pub struct RegistrationApplicationView {
138 pub registration_application: RegistrationApplication,
139 pub creator_local_user: LocalUser,
141 pub admin: Option<Person>,
144 #[derive(Debug, Serialize, Deserialize, Clone)]
145 #[cfg_attr(feature = "full", derive(TS))]
146 #[cfg_attr(feature = "full", ts(export))]
148 pub struct SiteView {
150 pub local_site: LocalSite,
151 pub local_site_rate_limit: LocalSiteRateLimit,
152 pub counts: SiteAggregates,
155 #[derive(Debug, Serialize, Deserialize, Clone)]
156 #[cfg_attr(feature = "full", derive(TS))]
157 #[cfg_attr(feature = "full", ts(export))]
158 /// A custom emoji view.
159 pub struct CustomEmojiView {
160 pub custom_emoji: CustomEmoji,
161 pub keywords: Vec<CustomEmojiKeyword>,