atrium_api/com/atproto/repo/
get_record.rs

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