use serde::{Deserialize, Serialize}; use super::instance::Instance; #[derive(Hash, Clone, Serialize, Deserialize)] pub struct Repository { pub name: String, pub instance: Instance, } #[derive(Clone, Debug, Serialize, Deserialize)] pub struct RepositoryView { pub name: String, pub description: String, pub default_branch: String, pub latest_commit: CommitMetadata, pub files: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum RepositoryFile { Directory(String), File(String), } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RepositoryFileWithCommitMetadata { pub file: RepositoryFile, pub commit_metadata: CommitMetadata, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct CommitMetadata { pub author: String, pub message: String, pub hash: String, pub time: (), }