use derive_empty_traits::EmptyTraits;
use resolver_api::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::{
deployment::{_PartialDeploymentConfig, Deployment},
update::Update,
};
use super::KomodoWriteRequest;
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Deployment)]
#[error(serror::Error)]
pub struct CreateDeployment {
pub name: String,
#[serde(default)]
pub config: _PartialDeploymentConfig,
}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Deployment)]
#[error(serror::Error)]
pub struct CopyDeployment {
pub name: String,
pub id: String,
}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Deployment)]
#[error(serror::Error)]
pub struct CreateDeploymentFromContainer {
pub name: String,
pub server: String,
}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Deployment)]
#[error(serror::Error)]
pub struct DeleteDeployment {
pub id: String,
}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Deployment)]
#[error(serror::Error)]
pub struct UpdateDeployment {
pub id: String,
pub config: _PartialDeploymentConfig,
}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[empty_traits(KomodoWriteRequest)]
#[response(Update)]
#[error(serror::Error)]
pub struct RenameDeployment {
pub id: String,
pub name: String,
}