assemblyline_models/datastore/
filescore.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use struct_metadata::Described;
4
5use crate::{ElasticMeta, Readable, Sid};
6
7
8/// Model of Scoring related to a File
9#[derive(Serialize, Deserialize, Described, Clone)]
10#[metadata_type(ElasticMeta)]
11#[metadata(index=false, store=false)]
12pub struct FileScore {
13    /// Parent submission ID of the associated submission
14    pub psid: Option<Sid>,
15    /// Expiry timestamp, used for garbage collection
16    #[metadata(index=true)]
17    pub expiry_ts: DateTime<Utc>,
18    /// Maximum score for the associated submission
19    pub score: i32,
20    /// Number of errors that occurred during the previous analysis
21    pub errors: i32,
22    /// ID of the associated submission
23    pub sid: Sid,
24    /// Epoch time at which the FileScore entry was created
25    pub time: f32,
26}
27
28impl Readable for FileScore {
29    fn set_from_archive(&mut self, _from_archive: bool) {}
30}