From 8ad84bc72b8e58eab208941503da47ac19ede551 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 9 Apr 2024 22:45:04 +0100 Subject: [PATCH] feat(server): add deserialise types for commit status --- src/server/forge/forgejo/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/server/forge/forgejo/mod.rs b/src/server/forge/forgejo/mod.rs index 1a57b9e4..7588152f 100644 --- a/src/server/forge/forgejo/mod.rs +++ b/src/server/forge/forgejo/mod.rs @@ -64,3 +64,20 @@ async fn get_commit_history( struct Commit { sha: String, } + +#[derive(Debug, serde::Deserialize)] +pub struct CombinedStatus { + pub state: CommitStatusState, +} + +#[derive(Debug, serde::Deserialize)] +pub enum CommitStatusState { + #[serde(rename = "success")] + Success, + #[serde(rename = "pending")] + Pending, + #[serde(rename = "failure")] + Failure, + #[serde(rename = "error")] + Error, +}