atrium_api/com/atproto/repo/
delete_record.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.repo.deleteRecord` namespace.
3pub const NSID: &str = "com.atproto.repo.deleteRecord";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    ///The NSID of the record collection.
8    pub collection: crate::types::string::Nsid,
9    ///The handle or DID of the repo (aka, current account).
10    pub repo: crate::types::string::AtIdentifier,
11    ///The Record Key.
12    pub rkey: crate::types::string::RecordKey,
13    ///Compare and swap with the previous commit by CID.
14    #[serde(skip_serializing_if = "core::option::Option::is_none")]
15    pub swap_commit: core::option::Option<crate::types::string::Cid>,
16    ///Compare and swap with the previous record by CID.
17    #[serde(skip_serializing_if = "core::option::Option::is_none")]
18    pub swap_record: core::option::Option<crate::types::string::Cid>,
19}
20pub type Input = crate::types::Object<InputData>;
21#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
22#[serde(rename_all = "camelCase")]
23pub struct OutputData {
24    #[serde(skip_serializing_if = "core::option::Option::is_none")]
25    pub commit: core::option::Option<crate::com::atproto::repo::defs::CommitMeta>,
26}
27pub type Output = crate::types::Object<OutputData>;
28#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
29#[serde(tag = "error", content = "message")]
30pub enum Error {
31    InvalidSwap(Option<String>),
32}
33impl std::fmt::Display for Error {
34    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
35        match self {
36            Error::InvalidSwap(msg) => {
37                write!(_f, "InvalidSwap")?;
38                if let Some(msg) = msg {
39                    write!(_f, ": {msg}")?;
40                }
41            }
42        }
43        Ok(())
44    }
45}