zulip-api 0.0.8

Client library for interacting with the Zulip API
Documentation
use serde::{Deserialize, Serialize};

use crate::{impl_default, impl_display};

/// What typesof message edit history are accessible to users via [message edit history](https://zulip.com/help/view-a-messages-edit-history).
///
/// Present if `realm` is present in `fetch_event_types`.
///
/// - \"all\": All edit history is visible.
/// - \"moves\": Only moves are visible.
/// - \"none\": No edit history is visible.
///
/// **Changes**: New in Zulip 10.0 (feature level 358), replacing the previous `allow_edit_history` boolean setting; `true` corresponds to `all`, and `false` to `none`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum RealmMessageEditHistoryVisibilityPolicy {
    /// All edit history is visible.
    All,
    /// Only moves are visible.
    Moves,
    /// No edit history is visible.
    None,
}

impl RealmMessageEditHistoryVisibilityPolicy {
    /// Creates a new [Self].
    pub const fn new() -> Self {
        Self::All
    }
}

impl_default!(RealmMessageEditHistoryVisibilityPolicy);
impl_display!(RealmMessageEditHistoryVisibilityPolicy);