Skip to main content

zulip_api/message/channel_permission/
can_administer_channel_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 administer this channel.
6///
7/// Organization administrators can administer every channel as though they were in this group without being explicitly listed here.
8///
9/// Note that a user must have metadata access to a channel and permission to administer the channel in order to modify this setting.
10///
11/// **Changes**: Prior to Zulip 10.0 (feature level 349) a user needed to `have content access` to a channel in order to modify it. The exception to this rule was that organization administrators can edit channel names and descriptions without having full access to the channel.  New in Zulip 10.0 (feature level 325). Prior to this change, the permission to administer channels was limited to realm administrators.
12///
13/// Modified from `openapi-generator-cli` output:
14///
15/// ```shell,no_build,no_run
16/// $ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
17/// ```
18///
19/// ```text
20/// /*
21/// * Zulip REST API
22/// *
23/// * Powerful open source group chat
24/// *
25/// * The version of the OpenAPI document: 1.0.0
26/// *
27/// * Generated by: https://openapi-generator.tech
28/// */
29/// ```
30///
31/// See [zerver/openapi/zulip.yaml](https://github.com/zulip/zulip/blob/main/zerver/openapi/zulip.yaml) for the original OpenAPI configuration.
32///
33/// Configuration slightly modified to work with the Rust generator of [`openapi-generator-cli`](https://openapi-generator.tech).
34#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
35pub struct CanAdministerChannelGroup(pub GroupSetting);
36
37impl CanAdministerChannelGroup {
38    /// Creates a new [Self].
39    pub const fn new() -> Self {
40        Self(GroupSetting::new())
41    }
42
43    /// Converts the inner representation into a [Self].
44    pub const fn from_inner(val: GroupSetting) -> Self {
45        Self(val)
46    }
47
48    /// Converts the [Self] into the inner representation.
49    pub fn into_inner(self) -> GroupSetting {
50        self.0
51    }
52}
53
54impl Default for CanAdministerChannelGroup {
55    fn default() -> Self {
56        Self::new()
57    }
58}
59
60impl_cow!(CanAdministerChannelGroup);