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
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `com.atproto.repo.applyWrites` namespace.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Input {
    ///The handle or DID of the repo (aka, current account).
    pub repo: crate::types::string::AtIdentifier,
    ///If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub swap_commit: Option<crate::types::string::Cid>,
    ///Can be set to 'false' to skip Lexicon schema validation of record data, for all operations.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub validate: Option<bool>,
    pub writes: Vec<InputWritesItem>,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///Indicates that the 'swapCommit' parameter did not match current commit.
    InvalidSwap(Option<String>),
}
///Operation which creates a new record.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Create {
    pub collection: crate::types::string::Nsid,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rkey: Option<String>,
    pub value: crate::records::Record,
}
///Operation which deletes an existing record.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Delete {
    pub collection: crate::types::string::Nsid,
    pub rkey: String,
}
///Operation which updates an existing record.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Update {
    pub collection: crate::types::string::Nsid,
    pub rkey: String,
    pub value: crate::records::Record,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum InputWritesItem {
    #[serde(rename = "com.atproto.repo.applyWrites#create")]
    Create(Box<Create>),
    #[serde(rename = "com.atproto.repo.applyWrites#update")]
    Update(Box<Update>),
    #[serde(rename = "com.atproto.repo.applyWrites#delete")]
    Delete(Box<Delete>),
}