zulip-api 0.0.8

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

use crate::{impl_cow, GroupSetting};

/// Represents a group-setting value defining the set of users who have permission to resolve topics in the channel.
///
/// Users who have similar realm-level permissions can resolve topics in a channel regardless of the value of this setting.
///
/// **Changes**: New in Zulip 11.0 (feature level 402).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CanResolveTopicsGroup(pub GroupSetting);

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

    /// Converts the inner representation into a [Self].
    pub const fn from_inner(val: GroupSetting) -> Self {
        Self(val)
    }

    /// Converts the [Self] into the inner representation.
    pub fn into_inner(self) -> GroupSetting {
        self.0
    }
}

impl Default for CanResolveTopicsGroup {
    fn default() -> Self {
        Self::new()
    }
}

impl_cow!(CanResolveTopicsGroup);