use serde::{Deserialize, Serialize};
use crate::{serde::StringEnum, PrivOwnedStr};
pub mod room;
pub mod server;
pub mod user;
#[derive(Clone, Debug, Deserialize, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct PolicyRuleEventContent {
pub entity: String,
pub recommendation: Recommendation,
pub reason: String,
}
impl PolicyRuleEventContent {
pub fn new(entity: String, recommendation: Recommendation, reason: String) -> Self {
Self { entity, recommendation, reason }
}
}
#[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))]
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
#[non_exhaustive]
pub enum Recommendation {
#[ruma_enum(rename = "m.ban")]
Ban,
#[doc(hidden)]
_Custom(PrivOwnedStr),
}
impl Recommendation {
pub fn as_str(&self) -> &str {
self.as_ref()
}
}