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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
use std::collections::HashMap;
use serde::{self, Deserialize, Serialize};
use crate::helpers::Class;
#[derive(Deserialize, Debug)]
pub struct Branch {
#[serde(rename = "SHA1")]
pub sha1: String,
pub name: String,
}
#[derive(Deserialize, Debug)]
pub struct Revision {
#[serde(rename = "SHA1")]
pub sha1: String,
pub branch: Vec<Branch>,
}
pub trait BranchBuild {}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct CommonBranchBuild {
#[serde(rename = "_class")]
pub class: Option<String>,
#[cfg(not(feature = "extra-fields-visibility"))]
#[serde(flatten)]
extra_fields: serde_json::Value,
#[cfg(feature = "extra-fields-visibility")]
#[serde(flatten)]
pub extra_fields: serde_json::Value,
}
specialize!(CommonBranchBuild => BranchBuild);
impl BranchBuild for CommonBranchBuild {}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GitBranchBuild {
pub revision: Revision,
pub build_number: u32,
pub build_result: Option<crate::build::BuildStatus>,
pub marked: Revision,
}
register_class!("hudson.plugins.git.util.Build" => GitBranchBuild);
impl BranchBuild for GitBranchBuild {}
#[derive(Deserialize, Debug)]
pub struct BuildsByBranch {
#[serde(flatten)]
pub branches: HashMap<String, CommonBranchBuild>,
}