rebuilderd_common/api/v1/models/
package.rs1use crate::api::v1::{ArtifactStatus, BuildStatus};
2use chrono::NaiveDateTime;
3#[cfg(feature = "diesel")]
4use diesel::Queryable;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
8pub struct PackageReport {
9 pub distribution: String,
10 pub release: Option<String>,
11 pub architecture: String,
12 pub packages: Vec<SourcePackageReport>,
13}
14
15#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
16pub struct SourcePackageReport {
17 pub name: String,
18 pub version: String,
19 pub url: String,
20 pub artifacts: Vec<BinaryPackageReport>,
21}
22
23#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
24pub struct BinaryPackageReport {
25 pub name: String,
26 pub version: String,
27 pub component: Option<String>,
28 pub architecture: String,
29 pub url: String,
30}
31
32#[derive(Debug, Serialize, Deserialize)]
33#[cfg_attr(feature = "diesel", derive(Queryable))]
34#[cfg_attr(feature = "diesel", diesel(check_for_backend(diesel::sqlite::Sqlite)))]
35pub struct SourcePackage {
36 pub id: i32,
37 pub name: String,
38 pub version: String,
39 pub distribution: String,
40 pub release: Option<String>,
41 pub status: Option<BuildStatus>,
42 pub build_id: Option<i32>,
43 pub last_seen: NaiveDateTime,
44 pub seen_in_last_sync: bool,
45}
46
47#[derive(Debug, Serialize, Deserialize)]
48#[cfg_attr(feature = "diesel", derive(Queryable))]
49#[cfg_attr(feature = "diesel", diesel(check_for_backend(diesel::sqlite::Sqlite)))]
50pub struct BinaryPackage {
51 pub id: i32,
52 pub name: String,
53 pub version: String,
54 pub distribution: String,
55 pub release: Option<String>,
56 pub component: Option<String>,
57 pub architecture: String,
58 pub url: String,
59 pub status: Option<ArtifactStatus>,
60 pub build_id: Option<i32>,
61 pub artifact_id: Option<i32>,
62 pub diffoscope_log_id: Option<i32>,
63 pub attestation_log_id: Option<i32>,
64 pub last_seen: NaiveDateTime,
65 pub seen_in_last_sync: bool,
66}