use mogh_resolver::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::{
action::{_PartialActionConfig, Action},
update::Update,
};
use super::KomodoWriteRequest;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/CreateAction",
description = "Create an action.",
request_body(content = CreateAction),
responses(
(status = 200, description = "The new action", body = crate::entities::action::ActionSchema),
),
)]
pub fn create_action() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Action)]
#[error(mogh_error::Error)]
pub struct CreateAction {
pub name: String,
#[serde(default)]
pub config: _PartialActionConfig,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/CopyAction",
description = "Copy an action.",
request_body(content = CopyAction),
responses(
(status = 200, description = "The new action", body = crate::entities::action::ActionSchema),
),
)]
pub fn copy_action() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Action)]
#[error(mogh_error::Error)]
pub struct CopyAction {
pub name: String,
pub id: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/DeleteAction",
description = "Delete an action.",
request_body(content = DeleteAction),
responses(
(status = 200, description = "The deleted action", body = crate::entities::action::ActionSchema),
),
)]
pub fn delete_action() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Action)]
#[error(mogh_error::Error)]
pub struct DeleteAction {
pub id: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/UpdateAction",
description = "Update an action.",
request_body(content = UpdateAction),
responses(
(status = 200, description = "The updated action", body = crate::entities::action::ActionSchema),
),
)]
pub fn update_action() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Action)]
#[error(mogh_error::Error)]
pub struct UpdateAction {
pub id: String,
pub config: _PartialActionConfig,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/RenameAction",
description = "Rename an action.",
request_body(content = RenameAction),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn rename_action() {}
#[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 RenameAction {
pub id: String,
pub name: String,
}