1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use std::borrow::Cow;
use super::Request;
use crate::{
settings::Settings,
job::{ JobId, JobStatus },
};
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Status {
pub job_id: JobId,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StatusResponse {
#[serde(rename = "_id")]
pub job_id: JobId,
pub status: JobStatus,
#[serde(default, rename = "pdbName", skip_serializing_if = "Option::is_none")]
pub pdb_id: Option<String>,
#[serde(default, rename = "fileName", skip_serializing_if = "Option::is_none")]
pub file_name: Option<String>,
#[serde(flatten, default)]
pub settings: Settings,
}
impl Request for Status {
type Body = ();
type Response = StatusResponse;
fn endpoint(&self) -> Cow<str> {
format!("/status/{}", self.job_id).into()
}
}