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