atrium_api/com/atproto/sync/
get_blocks.rs

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