use clap::Parser;
use mogh_resolver::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::update::Update;
use super::{BatchExecutionResponse, KomodoExecuteRequest};
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/CloneRepo",
description = "Clones the target repo.",
request_body(content = CloneRepo),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn clone_repo() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct CloneRepo {
pub repo: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/BatchCloneRepo",
description = "Clones multiple Repos in parallel that match pattern.",
request_body(content = BatchCloneRepo),
responses(
(status = 200, description = "The batch execution response", body = BatchExecutionResponse),
),
)]
pub fn batch_clone_repo() {}
#[typeshare]
#[derive(
Debug, Clone, PartialEq, Serialize, Deserialize, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(BatchExecutionResponse)]
#[error(mogh_error::Error)]
pub struct BatchCloneRepo {
pub pattern: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/PullRepo",
description = "Pulls the target repo.",
request_body(content = PullRepo),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn pull_repo() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct PullRepo {
pub repo: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/BatchPullRepo",
description = "Pulls multiple Repos in parallel that match pattern.",
request_body(content = BatchPullRepo),
responses(
(status = 200, description = "The batch execution response", body = BatchExecutionResponse),
),
)]
pub fn batch_pull_repo() {}
#[typeshare]
#[derive(
Debug, Clone, PartialEq, Serialize, Deserialize, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(BatchExecutionResponse)]
#[error(mogh_error::Error)]
pub struct BatchPullRepo {
pub pattern: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/BuildRepo",
description = "Builds the target repo, using the attached builder.",
request_body(content = BuildRepo),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn build_repo() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct BuildRepo {
pub repo: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/BatchBuildRepo",
description = "Builds multiple Repos in parallel that match pattern.",
request_body(content = BatchBuildRepo),
responses(
(status = 200, description = "The batch execution response", body = BatchExecutionResponse),
),
)]
pub fn batch_build_repo() {}
#[typeshare]
#[derive(
Debug, Clone, PartialEq, Serialize, Deserialize, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(BatchExecutionResponse)]
#[error(mogh_error::Error)]
pub struct BatchBuildRepo {
pub pattern: String,
}
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/CancelRepoBuild",
description = "Cancels the target repo build.",
request_body(content = CancelRepoBuild),
responses(
(status = 200, description = "The update", body = Update),
),
)]
pub fn cancel_repo_build() {}
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, PartialEq, Resolve, Parser,
)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoExecuteRequest)]
#[response(Update)]
#[error(mogh_error::Error)]
pub struct CancelRepoBuild {
pub repo: String,
}