zulip_api/message/role.rs
1use serde_repr::{Deserialize_repr, Serialize_repr};
2
3use crate::{impl_default, impl_display};
4
5/// Represents a user role.
6#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
7#[repr(u64)]
8pub enum Role {
9 /// Represents a `Organization owner` role.
10 OrganizationOwner = 100,
11 /// Represents a `Organization administrator` bot.
12 OrganizationAdministrator = 200,
13 /// Represents a `Organization moderator` bot.
14 OrganizationModerator = 300,
15 /// Represents a `Member` bot.
16 Member = 400,
17 /// Represents a `Guest` bot.
18 Guest = 600,
19}
20
21impl Role {
22 /// Creates a new [Role].
23 pub const fn new() -> Self {
24 Self::OrganizationOwner
25 }
26}
27
28impl_default!(Role);
29impl_display!(Role);