#![doc = "Definitions for the `com.atproto.sync.getHead` namespace."]
#[doc = "`com.atproto.sync.getHead`"]
#[doc = "Gets the current HEAD CID of a repo."]
#[async_trait::async_trait]
pub trait GetHead: crate::xrpc::XrpcClient {
async fn get_head(&self, params: Parameters) -> Result<Output, Box<dyn std::error::Error>> {
let body = crate::xrpc::XrpcClient::send::<Error>(
self,
http::Method::GET,
"com.atproto.sync.getHead",
Some(serde_qs::to_string(¶ms)?),
None,
None,
)
.await?;
serde_json::from_slice(&body).map_err(|e| e.into())
}
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
#[doc = "The DID of the repo."]
pub did: String,
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Output {
pub root: String,
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {}