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.createActivity` namespace.
pub const NSID: &str = "tools.ozone.report.createActivity";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///The type of activity to record.
    pub activity: crate::types::Union<InputActivityRefs>,
    ///ID of the report moderation event. Resolves to the report created from that event. Exactly one of reportId or eventId must be provided.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub event_id: core::option::Option<i64>,
    ///Optional moderator-only note. Not visible to reporters.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub internal_note: core::option::Option<String>,
    ///Set true when this activity is triggered by an automated process. Defaults to false.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub is_automated: core::option::Option<bool>,
    ///Optional public-facing note, potentially visible to the reporter.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub public_note: core::option::Option<String>,
    ///ID of the report to record activity on. Exactly one of reportId or eventId must be provided.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub report_id: core::option::Option<i64>,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    pub activity: crate::tools::ozone::report::defs::ReportActivityView,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///No report exists with the given reportId or eventId
    ReportNotFound(Option<String>),
    ///The requested state transition is not permitted from the report's current status
    InvalidStateTransition(Option<String>),
    ///The report is already in the status implied by this activity type
    AlreadyInTargetState(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::ReportNotFound(msg) => {
                write!(_f, "ReportNotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidStateTransition(msg) => {
                write!(_f, "InvalidStateTransition")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::AlreadyInTargetState(msg) => {
                write!(_f, "AlreadyInTargetState")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum InputActivityRefs {
    #[serde(rename = "tools.ozone.report.defs#queueActivity")]
    ToolsOzoneReportDefsQueueActivity(
        Box<crate::tools::ozone::report::defs::QueueActivity>,
    ),
    #[serde(rename = "tools.ozone.report.defs#assignmentActivity")]
    ToolsOzoneReportDefsAssignmentActivity(
        Box<crate::tools::ozone::report::defs::AssignmentActivity>,
    ),
    #[serde(rename = "tools.ozone.report.defs#escalationActivity")]
    ToolsOzoneReportDefsEscalationActivity(
        Box<crate::tools::ozone::report::defs::EscalationActivity>,
    ),
    #[serde(rename = "tools.ozone.report.defs#closeActivity")]
    ToolsOzoneReportDefsCloseActivity(
        Box<crate::tools::ozone::report::defs::CloseActivity>,
    ),
    #[serde(rename = "tools.ozone.report.defs#reopenActivity")]
    ToolsOzoneReportDefsReopenActivity(
        Box<crate::tools::ozone::report::defs::ReopenActivity>,
    ),
    #[serde(rename = "tools.ozone.report.defs#noteActivity")]
    ToolsOzoneReportDefsNoteActivity(
        Box<crate::tools::ozone::report::defs::NoteActivity>,
    ),
}