gritlab/
status.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Deserialize, Serialize)]
5pub struct Author {
6    pub id: i64,
7    pub name: String,
8    pub username: String,
9    pub state: String,
10    pub avatar_url: Option<String>,
11    pub web_url: Option<String>,
12}
13
14#[derive(Debug, Deserialize, Serialize)]
15pub struct Status {
16    pub id: i64,
17    pub sha: String,
18    #[serde(rename = "ref")]
19    pub ref_: String,
20    pub status: String,
21    pub name: String,
22    pub target_url: String,
23    pub description: String,
24    pub created_at: DateTime<Utc>,
25    pub started_at: Option<DateTime<Utc>>,
26    pub finished_at: DateTime<Utc>,
27    pub allow_failure: bool,
28    pub coverage: Option<f64>,
29    pub author: Author,
30}
31
32#[derive(Debug, Deserialize, Serialize)]
33pub struct CreateStatusOption {
34    pub state: String,
35    #[serde(rename = "ref")]
36    pub ref_: Option<String>,
37    pub context: Option<String>,
38    pub target_url: Option<String>,
39    pub description: Option<String>,
40    pub coverage: Option<f64>,
41    pub pipeline_id: Option<i64>,
42}