// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.sync.getBlob // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, bon::Builder )] #[builder(start_fn = new)] #[serde(rename_all = "camelCase")] pub struct GetBlob<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, } impl jacquard_common::IntoStatic for GetBlob<'_> { type Output = GetBlob<'static>; fn into_static(self) -> Self::Output { GetBlob { cid: self.cid.into_static(), did: self.did.into_static(), } } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetBlobOutput<'a> {} impl jacquard_common::IntoStatic for GetBlobOutput<'_> { type Output = GetBlobOutput<'static>; fn into_static(self) -> Self::Output { GetBlobOutput { extra_data: self.extra_data.into_static(), } } } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum GetBlobError<'a> { #[serde(rename = "BlobNotFound")] BlobNotFound(std::option::Option), #[serde(rename = "RepoNotFound")] RepoNotFound(std::option::Option), #[serde(rename = "RepoTakendown")] RepoTakendown(std::option::Option), #[serde(rename = "RepoSuspended")] RepoSuspended(std::option::Option), #[serde(rename = "RepoDeactivated")] RepoDeactivated(std::option::Option), } impl std::fmt::Display for GetBlobError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::BlobNotFound(msg) => { write!(f, "BlobNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::RepoNotFound(msg) => { write!(f, "RepoNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::RepoTakendown(msg) => { write!(f, "RepoTakendown")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::RepoSuspended(msg) => { write!(f, "RepoSuspended")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::RepoDeactivated(msg) => { write!(f, "RepoDeactivated")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } impl jacquard_common::IntoStatic for GetBlobError<'_> { type Output = GetBlobError<'static>; fn into_static(self) -> Self::Output { match self { GetBlobError::BlobNotFound(v) => GetBlobError::BlobNotFound(v.into_static()), GetBlobError::RepoNotFound(v) => GetBlobError::RepoNotFound(v.into_static()), GetBlobError::RepoTakendown(v) => { GetBlobError::RepoTakendown(v.into_static()) } GetBlobError::RepoSuspended(v) => { GetBlobError::RepoSuspended(v.into_static()) } GetBlobError::RepoDeactivated(v) => { GetBlobError::RepoDeactivated(v.into_static()) } GetBlobError::Unknown(v) => GetBlobError::Unknown(v.into_static()), } } } impl jacquard_common::types::xrpc::XrpcRequest for GetBlob<'_> { const NSID: &'static str = "com.atproto.sync.getBlob"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "*/*"; type Output<'de> = GetBlobOutput<'de>; type Err<'de> = GetBlobError<'de>; }