pub const NSID: &str = "tools.ozone.report.reassignQueue";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub comment: core::option::Option<String>,
pub queue_id: i64,
pub report_id: 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 report: crate::tools::ozone::report::defs::ReportView,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
ReportNotFound(Option<String>),
ReportClosed(Option<String>),
AlreadyInTargetQueue(Option<String>),
QueueNotFound(Option<String>),
QueueDisabled(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::ReportClosed(msg) => {
write!(_f, "ReportClosed")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::AlreadyInTargetQueue(msg) => {
write!(_f, "AlreadyInTargetQueue")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::QueueNotFound(msg) => {
write!(_f, "QueueNotFound")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::QueueDisabled(msg) => {
write!(_f, "QueueDisabled")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}