use mogh_resolver::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::{
alerter::{_PartialAlerterConfig, Alerter},
update::Update,
};
use super::KomodoWriteRequest;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/CreateAlerter",
description = "Create an alerter.",
request_body(content = CreateAlerter),
responses(
(status = 200, description = "The new alerter", body = crate::entities::alerter::AlerterSchema),
),
)]
pub fn create_alerter() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Alerter)]
#[error(mogh_error::Error)]
pub struct CreateAlerter {
pub name: String,
#[serde(default)]
pub config: _PartialAlerterConfig,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/CopyAlerter",
description = "Copy an alerter.",
request_body(content = CopyAlerter),
responses(
(status = 200, description = "The new alerter", body = crate::entities::alerter::AlerterSchema),
),
)]
pub fn copy_alerter() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Alerter)]
#[error(mogh_error::Error)]
pub struct CopyAlerter {
pub name: String,
pub id: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DeleteAlerter",
description = "Delete an alerter.",
request_body(content = DeleteAlerter),
responses(
(status = 200, description = "The deleted alerter", body = crate::entities::alerter::AlerterSchema),
),
)]
pub fn delete_alerter() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Alerter)]
#[error(mogh_error::Error)]
pub struct DeleteAlerter {
pub id: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/UpdateAlerter",
description = "Update an alerter.",
request_body(content = UpdateAlerter),
responses(
(status = 200, description = "The updated alerter", body = crate::entities::alerter::AlerterSchema),
),
)]
pub fn update_alerter() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Alerter)]
#[error(mogh_error::Error)]
pub struct UpdateAlerter {
pub id: String,
pub config: _PartialAlerterConfig,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/RenameAlerter",
description = "Rename an alerter.",
request_body(content = RenameAlerter),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn rename_alerter() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct RenameAlerter {
pub id: String,
pub name: String,
}