atrium_api/com/atproto/sync/
get_blob.rs

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