1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use serde::{Deserialize, Serialize};
use crate::{impl_default, impl_display};
/// A JSON-encoded array indicating which types of events you're interested
/// in. Values that you might find useful include:
///
/// - **message** (messages)
/// - **subscription** (changes in your subscriptions)
/// - **realm_user** (changes to users in the organization and
/// their properties, such as their name).
///
/// If you do not specify this parameter, you will receive all
/// events, and have to filter out the events not relevant to
/// your client in your client code. For most applications, one
/// is only interested in messages, so one specifies:
/// `"event_types": ["message"]`
///
/// Event types not supported by the server are ignored, in order to simplify
/// the implementation of client apps that support multiple server versions.
///
/// For details see: <https://zulip.com/api/get-events#events-by-type>
#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum EventType {
AlertWords,
Attachment,
ChannelFolder,
CustomProfileFields,
DefaultStreamGroups,
DefaultStreams,
DeleteMessage,
Drafts,
HasZoomToken,
Heartbeat,
InvitesChanged,
Message,
MutedTopics,
MutedUsers,
NavigationView,
OnboardingSteps,
Presence,
PushDevice,
Reaction,
Realm,
RealmBot,
RealmDomains,
RealmEmoji,
RealmExport,
RealmExportConsent,
RealmFilters,
RealmLinkifiers,
RealmPlaygrounds,
RealmUser,
RealmUserSettingsDefaults,
Reminders,
Restart,
SavedSnippets,
ScheduledMessages,
Stream,
Submessage,
Subscription,
Typing,
TypingEditMessage,
UpdateDisplaySettings,
UpdateGlobalNotifications,
UpdateMessage,
UpdateMessageFlags,
UserGroup,
UserSettings,
UserStatus,
UserTopic,
WebReloadClient,
}
impl EventType {
/// Creates a new [EventType].
pub const fn new() -> Self {
Self::AlertWords
}
}
impl_default!(EventType);
impl_display!(EventType);