Skip to main content

atrium_api/com/atproto/repo/
put_record.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.repo.putRecord` namespace.
3pub const NSID: &str = "com.atproto.repo.putRecord";
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 record to write.
10    pub record: crate::types::Unknown,
11    ///The handle or DID of the repo (aka, current account).
12    pub repo: crate::types::string::AtIdentifier,
13    ///The Record Key.
14    pub rkey: crate::types::string::RecordKey,
15    ///Compare and swap with the previous commit by CID.
16    #[serde(skip_serializing_if = "core::option::Option::is_none")]
17    pub swap_commit: core::option::Option<crate::types::string::Cid>,
18    ///Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation
19    #[serde(skip_serializing_if = "core::option::Option::is_none")]
20    pub swap_record: core::option::Option<crate::types::string::Cid>,
21    ///Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.
22    #[serde(skip_serializing_if = "core::option::Option::is_none")]
23    pub validate: core::option::Option<bool>,
24}
25pub type Input = crate::types::Object<InputData>;
26#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
27#[serde(rename_all = "camelCase")]
28pub struct OutputData {
29    pub cid: crate::types::string::Cid,
30    #[serde(skip_serializing_if = "core::option::Option::is_none")]
31    pub commit: core::option::Option<crate::com::atproto::repo::defs::CommitMeta>,
32    pub uri: String,
33    #[serde(skip_serializing_if = "core::option::Option::is_none")]
34    pub validation_status: core::option::Option<String>,
35}
36pub type Output = crate::types::Object<OutputData>;
37#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
38#[serde(tag = "error", content = "message")]
39pub enum Error {
40    InvalidSwap(Option<String>),
41}
42impl std::fmt::Display for Error {
43    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
44        match self {
45            Error::InvalidSwap(msg) => {
46                write!(_f, "InvalidSwap")?;
47                if let Some(msg) = msg {
48                    write!(_f, ": {msg}")?;
49                }
50            }
51        }
52        Ok(())
53    }
54}