rust api: action_submission_validate

This commit is contained in:
Quaternions 2024-12-06 19:42:31 -08:00
parent f99dbb1b9d
commit 3289376f8e

View File

@ -54,6 +54,8 @@ pub struct UpdateSubmissionModelRequest{
pub ModelVersion:u64, pub ModelVersion:u64,
} }
pub struct SubmissionID(pub i64);
#[derive(Clone)] #[derive(Clone)]
pub struct Context{ pub struct Context{
base_url:String, base_url:String,
@ -116,6 +118,15 @@ impl Context{
self.patch(url).await.map_err(Error::Reqwest)? self.patch(url).await.map_err(Error::Reqwest)?
.error_for_status().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(()) Ok(())
} }
} }