use mogh_resolver::Resolve;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::provider::{
GitProviderAccount, ImageRegistryAccount,
};
use super::KomodoReadRequest;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/GetGitProviderAccount",
description = "Get a specific git provider account.",
request_body(content = GetGitProviderAccount),
responses(
(status = 200, description = "The git provider account", body = GetGitProviderAccountResponse),
),
)]
pub fn get_git_provider_account() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoReadRequest)]
#[response(GetGitProviderAccountResponse)]
#[error(mogh_error::Error)]
pub struct GetGitProviderAccount {
pub id: String,
}
#[typeshare]
pub type GetGitProviderAccountResponse = GitProviderAccount;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/ListGitProviderAccounts",
description = "List git provider accounts matching optional query.",
request_body(content = ListGitProviderAccounts),
responses(
(status = 200, description = "The list of git provider accounts", body = ListGitProviderAccountsResponse),
),
)]
pub fn list_git_provider_accounts() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Default, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoReadRequest)]
#[response(ListGitProviderAccountsResponse)]
#[error(mogh_error::Error)]
pub struct ListGitProviderAccounts {
pub domain: Option<String>,
pub username: Option<String>,
}
#[typeshare]
pub type ListGitProviderAccountsResponse = Vec<GitProviderAccount>;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/GetImageRegistryAccount",
description = "Get a specific image registry account.",
request_body(content = GetImageRegistryAccount),
responses(
(status = 200, description = "The image registry account", body = GetImageRegistryAccountResponse),
),
)]
pub fn get_image_registry_account() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoReadRequest)]
#[response(GetImageRegistryAccountResponse)]
#[error(mogh_error::Error)]
pub struct GetImageRegistryAccount {
pub id: String,
}
#[typeshare]
pub type GetImageRegistryAccountResponse = ImageRegistryAccount;
#[cfg(feature = "utoipa")]
#[utoipa::path(
post,
path = "/ListImageRegistryAccounts",
description = "List image registry accounts matching optional query.",
request_body(content = ListImageRegistryAccounts),
responses(
(status = 200, description = "The list of image registry accounts", body = ListImageRegistryAccountsResponse),
),
)]
pub fn list_image_registry_accounts() {}
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Default, Resolve)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[empty_traits(KomodoReadRequest)]
#[response(ListImageRegistryAccountsResponse)]
#[error(mogh_error::Error)]
pub struct ListImageRegistryAccounts {
pub domain: Option<String>,
pub username: Option<String>,
}
#[typeshare]
pub type ListImageRegistryAccountsResponse =
Vec<ImageRegistryAccount>;