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
use litty::literal;
use serde::{Deserialize, Serialize};
/// Collection base type.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CollectionBase {
/// Schema version.
pub v: CollectionBaseV1,
/// Unix timestamp in milliseconds when the collection version was updated.
pub time: i64,
/// Major collection version number.
pub major: u16,
/// Minor collection version number.
pub minor: u16,
/// Signifies if the collection version is a draft.
pub draft: bool,
}
#[literal(1)]
pub struct CollectionBaseV1;
/// Collection version.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CollectionV1 {
/// Schema version.
pub v: CollectionBaseV1,
/// Unix timestamp in milliseconds when the collection version was updated.
pub time: i64,
/// Major collection version number.
pub major: u16,
/// Minor collection version number.
pub minor: u16,
/// Signifies if the collection version is a draft.
pub draft: bool,
/// Collection payload JSON.
pub payload: String,
/// Collection settings JSON.
pub settings: Option<String>,
}
/// Parsed collection version. Unlike regular collection, the payload property is a parsed JSON object.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CollectionParsedV1 {
/// Schema version.
pub v: CollectionBaseV1,
/// Unix timestamp in milliseconds when the collection version was updated.
pub time: i64,
/// Major collection version number.
pub major: u16,
/// Minor collection version number.
pub minor: u16,
/// Signifies if the collection version is a draft.
pub draft: bool,
/// Collection payload.
pub payload: super::payload::PayloadV1,
/// Collection settings.
pub settings: CollectionSettings,
}
/// Collection settings object. Unused for now.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CollectionSettings {
CollectionSettingsObj(CollectionSettingsObj),
Null(()),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CollectionSettingsObj {}