From 3289376f8e1e0fe19ff731931dda9d98ace860c3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 6 Dec 2024 19:42:31 -0800 Subject: [PATCH] rust api: action_submission_validate --- validation/api/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/validation/api/src/lib.rs b/validation/api/src/lib.rs index d1ec5d3..3034cc6 100644 --- a/validation/api/src/lib.rs +++ b/validation/api/src/lib.rs @@ -54,6 +54,8 @@ pub struct UpdateSubmissionModelRequest{ pub ModelVersion:u64, } +pub struct SubmissionID(pub i64); + #[derive(Clone)] pub struct Context{ base_url:String, @@ -116,6 +118,15 @@ impl Context{ self.patch(url).await.map_err(Error::Reqwest)? .error_for_status().map_err(Error::Reqwest)?; + Ok(()) + } + pub async fn action_submission_validate(&self,config:SubmissionID)->Result<(),Error>{ + let url_raw=format!("{}/submissions/{}/status/validate",self.base_url,config.0); + let url=reqwest::Url::parse(url_raw.as_str()).map_err(Error::ParseError)?; + + self.patch(url).await.map_err(Error::Reqwest)? + .error_for_status().map_err(Error::Reqwest)?; + Ok(()) } }