A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: com.atproto.sync.getRepoStatus 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 GetRepoStatus<'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 GetRepoStatusOutput<'a> { 37 pub active: bool, 38 #[serde(borrow)] 39 pub did: jacquard_common::types::string::Did<'a>, 40 ///Optional field, the current rev of the repo, if active=true 41 #[serde(skip_serializing_if = "std::option::Option::is_none")] 42 pub rev: std::option::Option<jacquard_common::types::string::Tid>, 43 ///If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. 44 #[serde(skip_serializing_if = "std::option::Option::is_none")] 45 #[serde(borrow)] 46 pub status: std::option::Option<jacquard_common::CowStr<'a>>, 47} 48 49#[jacquard_derive::open_union] 50#[derive( 51 serde::Serialize, 52 serde::Deserialize, 53 Debug, 54 Clone, 55 PartialEq, 56 Eq, 57 thiserror::Error, 58 miette::Diagnostic, 59 jacquard_derive::IntoStatic 60)] 61#[serde(tag = "error", content = "message")] 62#[serde(bound(deserialize = "'de: 'a"))] 63pub enum GetRepoStatusError<'a> { 64 #[serde(rename = "RepoNotFound")] 65 RepoNotFound(std::option::Option<String>), 66} 67 68impl std::fmt::Display for GetRepoStatusError<'_> { 69 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 70 match self { 71 Self::RepoNotFound(msg) => { 72 write!(f, "RepoNotFound")?; 73 if let Some(msg) = msg { 74 write!(f, ": {}", msg)?; 75 } 76 Ok(()) 77 } 78 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 79 } 80 } 81} 82 83///Response type for 84///com.atproto.sync.getRepoStatus 85pub struct GetRepoStatusResponse; 86impl jacquard_common::xrpc::XrpcResp for GetRepoStatusResponse { 87 const NSID: &'static str = "com.atproto.sync.getRepoStatus"; 88 const ENCODING: &'static str = "application/json"; 89 type Output<'de> = GetRepoStatusOutput<'de>; 90 type Err<'de> = GetRepoStatusError<'de>; 91} 92 93impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepoStatus<'a> { 94 const NSID: &'static str = "com.atproto.sync.getRepoStatus"; 95 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 96 type Response = GetRepoStatusResponse; 97} 98 99///Endpoint type for 100///com.atproto.sync.getRepoStatus 101pub struct GetRepoStatusRequest; 102impl jacquard_common::xrpc::XrpcEndpoint for GetRepoStatusRequest { 103 const PATH: &'static str = "/xrpc/com.atproto.sync.getRepoStatus"; 104 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 105 type Request<'de> = GetRepoStatus<'de>; 106 type Response = GetRepoStatusResponse; 107}