atrium-api 0.25.8

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `tools.ozone.safelink.updateRule` namespace.
pub const NSID: &str = "tools.ozone.safelink.updateRule";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    pub action: crate::tools::ozone::safelink::defs::ActionType,
    ///Optional comment about the update
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub comment: core::option::Option<String>,
    ///Optional DID to credit as the creator. Only respected for admin_token authentication.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub created_by: core::option::Option<crate::types::string::Did>,
    pub pattern: crate::tools::ozone::safelink::defs::PatternType,
    pub reason: crate::tools::ozone::safelink::defs::ReasonType,
    ///The URL or domain to update the rule for
    pub url: String,
}
pub type Input = crate::types::Object<InputData>;
pub type Output = crate::tools::ozone::safelink::defs::Event;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///No active rule found for this URL/domain
    RuleNotFound(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::RuleNotFound(msg) => {
                write!(_f, "RuleNotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}