atrium_api/com/atproto/sync/
get_record.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `com.atproto.sync.getRecord` namespace.
3pub const NSID: &str = "com.atproto.sync.getRecord";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    pub collection: crate::types::string::Nsid,
8    ///The DID of the repo.
9    pub did: crate::types::string::Did,
10    ///Record Key
11    pub rkey: crate::types::string::RecordKey,
12}
13pub type Parameters = crate::types::Object<ParametersData>;
14#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
15#[serde(tag = "error", content = "message")]
16pub enum Error {
17    RecordNotFound(Option<String>),
18    RepoNotFound(Option<String>),
19    RepoTakendown(Option<String>),
20    RepoSuspended(Option<String>),
21    RepoDeactivated(Option<String>),
22}
23impl std::fmt::Display for Error {
24    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
25        match self {
26            Error::RecordNotFound(msg) => {
27                write!(_f, "RecordNotFound")?;
28                if let Some(msg) = msg {
29                    write!(_f, ": {msg}")?;
30                }
31            }
32            Error::RepoNotFound(msg) => {
33                write!(_f, "RepoNotFound")?;
34                if let Some(msg) = msg {
35                    write!(_f, ": {msg}")?;
36                }
37            }
38            Error::RepoTakendown(msg) => {
39                write!(_f, "RepoTakendown")?;
40                if let Some(msg) = msg {
41                    write!(_f, ": {msg}")?;
42                }
43            }
44            Error::RepoSuspended(msg) => {
45                write!(_f, "RepoSuspended")?;
46                if let Some(msg) = msg {
47                    write!(_f, ": {msg}")?;
48                }
49            }
50            Error::RepoDeactivated(msg) => {
51                write!(_f, "RepoDeactivated")?;
52                if let Some(msg) = msg {
53                    write!(_f, ": {msg}")?;
54                }
55            }
56        }
57        Ok(())
58    }
59}