zulip-api 0.0.8

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

use crate::{impl_default, impl_display};

/// Whether each returned channel object should include a `subscribers`
/// field containing a list of the user IDs of its subscribers.
///
/// Client apps supporting organizations with many thousands of users
/// should not pass `true`, because the full subscriber matrix may be
/// several megabytes of data. The `partial` value, combined with the
/// `subscriber_count` and fetching subscribers for individual channels as
/// needed, is recommended to support client app features where channel
/// subscriber data is useful.
///
/// If a client passes `partial` for this parameter, the server may,
/// for some channels, return a subset of the channel's subscribers
/// in the `partial_subscribers` field instead of the `subscribers` field,
/// which always contains the complete set of subscribers.
///
/// The server guarantees that it will always return a `subscribers`
/// field for channels with fewer than 250 total subscribers. When
/// returning a `partial_subscribers` field, the server guarantees
/// that all bot users and users active within the last 14 days will
/// be included. For other cases, the server may use its discretion
/// to determine which channels and users to include, balancing between
/// payload size and usefulness of the data provided to the client.
///
/// Passing `true` in an [unauthenticated
/// request](/help/public-access-option) is an error.
///
/// **Changes**: The `partial` value is new in Zulip 11.0 (feature level 412).
///
/// Before Zulip 6.0 (feature level 149), this parameter was silently
/// ignored and processed as though it were `false` in unauthenticated
/// requests.
///
/// New in Zulip 2.1.0.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum IncludeSubscribers {
    False,
    True,
    Partial,
}

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

impl_default!(IncludeSubscribers);
impl_display!(IncludeSubscribers);