Skip to main content

zulip_api/message/channel_permission/
can_resolve_topics_group.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{impl_cow, GroupSetting};
4
5/// Represents a group-setting value defining the set of users who have permission to resolve topics in the channel.
6///
7/// Users who have similar realm-level permissions can resolve topics in a channel regardless of the value of this setting.
8///
9/// **Changes**: New in Zulip 11.0 (feature level 402).
10#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11pub struct CanResolveTopicsGroup(pub GroupSetting);
12
13impl CanResolveTopicsGroup {
14    /// Creates a new [Self].
15    pub const fn new() -> Self {
16        Self(GroupSetting::new())
17    }
18
19    /// Converts the inner representation into a [Self].
20    pub const fn from_inner(val: GroupSetting) -> Self {
21        Self(val)
22    }
23
24    /// Converts the [Self] into the inner representation.
25    pub fn into_inner(self) -> GroupSetting {
26        self.0
27    }
28}
29
30impl Default for CanResolveTopicsGroup {
31    fn default() -> Self {
32        Self::new()
33    }
34}
35
36impl_cow!(CanResolveTopicsGroup);