atrium_api/com/atproto/sync/
get_latest_commit.rs1pub const NSID: &str = "com.atproto.sync.getLatestCommit";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7 pub did: crate::types::string::Did,
9}
10pub type Parameters = crate::types::Object<ParametersData>;
11#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
12#[serde(rename_all = "camelCase")]
13pub struct OutputData {
14 pub cid: crate::types::string::Cid,
15 pub rev: crate::types::string::Tid,
16}
17pub type Output = crate::types::Object<OutputData>;
18#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
19#[serde(tag = "error", content = "message")]
20pub enum Error {
21 RepoNotFound(Option<String>),
22 RepoTakendown(Option<String>),
23 RepoSuspended(Option<String>),
24 RepoDeactivated(Option<String>),
25}
26impl std::fmt::Display for Error {
27 fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
28 match self {
29 Error::RepoNotFound(msg) => {
30 write!(_f, "RepoNotFound")?;
31 if let Some(msg) = msg {
32 write!(_f, ": {msg}")?;
33 }
34 }
35 Error::RepoTakendown(msg) => {
36 write!(_f, "RepoTakendown")?;
37 if let Some(msg) = msg {
38 write!(_f, ": {msg}")?;
39 }
40 }
41 Error::RepoSuspended(msg) => {
42 write!(_f, "RepoSuspended")?;
43 if let Some(msg) = msg {
44 write!(_f, ": {msg}")?;
45 }
46 }
47 Error::RepoDeactivated(msg) => {
48 write!(_f, "RepoDeactivated")?;
49 if let Some(msg) = msg {
50 write!(_f, ": {msg}")?;
51 }
52 }
53 }
54 Ok(())
55 }
56}