aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine/src/com_atproto/repo/mod.rs
blob: de5b56b123403d56aebf61449a61ee8bca0f812b (plain)
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
/// com.atproto.repo types (manually entered)

#[allow(non_snake_case)]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)]
pub struct Describe {
    pub handle: String,
    pub did: String,
    pub didDoc: serde_json::Value,
    pub collections: Vec<String>,
    pub handleIsCorrect: bool,
}

#[allow(non_snake_case)]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)]
pub struct CreateRecord {
    pub did: String,
    pub collection: String,
    pub rkey: Option<String>,
    pub validate: Option<bool>,
    pub record: serde_json::Value,
    pub swapCommit: Option<String>,
}

#[allow(non_snake_case)]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)]
pub struct PutRecord {
    pub did: String,
    pub collection: String,
    pub rkey: String,
    pub validate: Option<bool>,
    pub record: serde_json::Value,
    pub swapRecord: Option<String>,
    pub swapCommit: Option<String>,
}

#[allow(non_snake_case)]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)]
pub struct DeleteRecord {
    pub did: String,
    pub collection: String,
    pub rkey: String,
    pub swapRecord: Option<String>,
    pub swapCommit: Option<String>,
}

#[allow(non_snake_case)]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)]
pub struct BatchWriteBody {
    pub repo: String,
    pub validate: Option<bool>,
    pub writes: Vec<BatchWrite>,
    pub swapCommit: Option<String>,
}

#[allow(non_snake_case)]
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)]
pub struct BatchWrite {
    #[serde(rename = "$type")]
    pub op_type: String,
    pub collection: String,
    pub rkey: Option<String>,
    pub value: Option<serde_json::Value>,
}