Skip to main content

atrium_api/tools/ozone/report/
reassign_queue.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `tools.ozone.report.reassignQueue` namespace.
3pub const NSID: &str = "tools.ozone.report.reassignQueue";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    ///Optional moderator-only note recorded on the resulting queueActivity as internalNote.
8    #[serde(skip_serializing_if = "core::option::Option::is_none")]
9    pub comment: core::option::Option<String>,
10    ///Target queue ID. Use -1 to unassign from any queue.
11    pub queue_id: i64,
12    ///ID of the report to reassign
13    pub report_id: i64,
14}
15pub type Input = crate::types::Object<InputData>;
16#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
17#[serde(rename_all = "camelCase")]
18pub struct OutputData {
19    pub report: crate::tools::ozone::report::defs::ReportView,
20}
21pub type Output = crate::types::Object<OutputData>;
22#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
23#[serde(tag = "error", content = "message")]
24pub enum Error {
25    ///No report exists with the given reportId
26    ReportNotFound(Option<String>),
27    ///The report is closed and cannot be reassigned
28    ReportClosed(Option<String>),
29    ///The report is already assigned to the target queue
30    AlreadyInTargetQueue(Option<String>),
31    ///No active queue exists with the given queueId
32    QueueNotFound(Option<String>),
33    ///The target queue is disabled and cannot receive new assignments
34    QueueDisabled(Option<String>),
35}
36impl std::fmt::Display for Error {
37    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
38        match self {
39            Error::ReportNotFound(msg) => {
40                write!(_f, "ReportNotFound")?;
41                if let Some(msg) = msg {
42                    write!(_f, ": {msg}")?;
43                }
44            }
45            Error::ReportClosed(msg) => {
46                write!(_f, "ReportClosed")?;
47                if let Some(msg) = msg {
48                    write!(_f, ": {msg}")?;
49                }
50            }
51            Error::AlreadyInTargetQueue(msg) => {
52                write!(_f, "AlreadyInTargetQueue")?;
53                if let Some(msg) = msg {
54                    write!(_f, ": {msg}")?;
55                }
56            }
57            Error::QueueNotFound(msg) => {
58                write!(_f, "QueueNotFound")?;
59                if let Some(msg) = msg {
60                    write!(_f, ": {msg}")?;
61                }
62            }
63            Error::QueueDisabled(msg) => {
64                write!(_f, "QueueDisabled")?;
65                if let Some(msg) = msg {
66                    write!(_f, ": {msg}")?;
67                }
68            }
69        }
70        Ok(())
71    }
72}