diff --git a/src/api/checks.rs b/src/api/checks.rs index 8960d1ad..92c64594 100644 --- a/src/api/checks.rs +++ b/src/api/checks.rs @@ -32,6 +32,12 @@ pub struct CreateCheckRunBuilder<'octo, 'r> { external_id: Option, #[serde(skip_serializing_if = "Option::is_none")] status: Option, + #[serde(skip_serializing_if = "Option::is_none")] + conclusion: Option, + #[serde(skip_serializing_if = "Option::is_none")] + completed_at: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + output: Option, } impl<'octo, 'r> CreateCheckRunBuilder<'octo, 'r> { @@ -43,6 +49,9 @@ impl<'octo, 'r> CreateCheckRunBuilder<'octo, 'r> { details_url: None, external_id: None, status: None, + conclusion: None, + completed_at: None, + output: None, } } @@ -66,6 +75,28 @@ impl<'octo, 'r> CreateCheckRunBuilder<'octo, 'r> { self } + /// The final conclusion of the check. + /// Can be one of `success`, `failure`, `neutral`, `cancelled`, `timed_out`, + /// `skipped`, `stale` or `action_required`. + pub fn conclusion(mut self, conclusion: impl Into) -> Self { + self.conclusion = Some(conclusion.into()); + self + } + + /// The time that the check run completed. + pub fn completed_at(mut self, completed_at: DateTime) -> Self { + self.completed_at = Some(completed_at); + self + } + + /// Check runs can accept a variety of data in the output object, + /// including a title and summary and can optionally provide + /// descriptive details about the run. + pub fn output(mut self, output: serde_json::Value) -> Self { + self.output = Some(output); + self + } + /// Sends the actual request. pub async fn send(self) -> Result { let route = format!(