zulip-api 0.0.8

Client library for interacting with the Zulip API
Documentation
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);