A better Rust ATProto crate
at main 2.8 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.moderation.getRepo 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 bon::Builder, 16 jacquard_derive::IntoStatic 17)] 18#[builder(start_fn = new)] 19#[serde(rename_all = "camelCase")] 20pub struct GetRepo<'a> { 21 #[serde(borrow)] 22 pub did: jacquard_common::types::string::Did<'a>, 23} 24 25#[jacquard_derive::lexicon] 26#[derive( 27 serde::Serialize, 28 serde::Deserialize, 29 Debug, 30 Clone, 31 PartialEq, 32 Eq, 33 jacquard_derive::IntoStatic 34)] 35#[serde(rename_all = "camelCase")] 36pub struct GetRepoOutput<'a> { 37 #[serde(flatten)] 38 #[serde(borrow)] 39 pub value: crate::tools_ozone::moderation::RepoViewDetail<'a>, 40} 41 42#[jacquard_derive::open_union] 43#[derive( 44 serde::Serialize, 45 serde::Deserialize, 46 Debug, 47 Clone, 48 PartialEq, 49 Eq, 50 thiserror::Error, 51 miette::Diagnostic, 52 jacquard_derive::IntoStatic 53)] 54#[serde(tag = "error", content = "message")] 55#[serde(bound(deserialize = "'de: 'a"))] 56pub enum GetRepoError<'a> { 57 #[serde(rename = "RepoNotFound")] 58 RepoNotFound(std::option::Option<String>), 59} 60 61impl std::fmt::Display for GetRepoError<'_> { 62 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 63 match self { 64 Self::RepoNotFound(msg) => { 65 write!(f, "RepoNotFound")?; 66 if let Some(msg) = msg { 67 write!(f, ": {}", msg)?; 68 } 69 Ok(()) 70 } 71 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 72 } 73 } 74} 75 76///Response type for 77///tools.ozone.moderation.getRepo 78pub struct GetRepoResponse; 79impl jacquard_common::xrpc::XrpcResp for GetRepoResponse { 80 const NSID: &'static str = "tools.ozone.moderation.getRepo"; 81 const ENCODING: &'static str = "application/json"; 82 type Output<'de> = GetRepoOutput<'de>; 83 type Err<'de> = GetRepoError<'de>; 84} 85 86impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepo<'a> { 87 const NSID: &'static str = "tools.ozone.moderation.getRepo"; 88 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 89 type Response = GetRepoResponse; 90} 91 92///Endpoint type for 93///tools.ozone.moderation.getRepo 94pub struct GetRepoRequest; 95impl jacquard_common::xrpc::XrpcEndpoint for GetRepoRequest { 96 const PATH: &'static str = "/xrpc/tools.ozone.moderation.getRepo"; 97 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 98 type Request<'de> = GetRepo<'de>; 99 type Response = GetRepoResponse; 100}