atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `tools.ozone.report.assignModerator` namespace.
pub const NSID: &str = "tools.ozone.report.assignModerator";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///DID to be assigned. Defaults to the caller's DID. Admins may assign to any moderator.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub did: core::option::Option<crate::types::string::Did>,
    ///When true, the assignment has no expiry (endAt is null). Throws AlreadyAssigned if another user already has a permanent assignment on this report.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub is_permanent: core::option::Option<bool>,
    ///Optional queue ID to associate the assignment with. If not provided and the report has been assigned on a queue before, it will stay on that queue.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub queue_id: core::option::Option<i64>,
    ///The ID of the report to assign.
    pub report_id: i64,
}
pub type Input = crate::types::Object<InputData>;
pub type Output = crate::tools::ozone::report::defs::AssignmentView;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///The report is already assigned to another user.
    AlreadyAssigned(Option<String>),
    ///The report ID or queue ID is invalid.
    InvalidAssignment(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::AlreadyAssigned(msg) => {
                write!(_f, "AlreadyAssigned")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidAssignment(msg) => {
                write!(_f, "InvalidAssignment")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}