A better Rust ATProto crate
at main 2.0 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.ocho.message.send 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 jacquard_derive::IntoStatic, 17 Default 18)] 19#[serde(rename_all = "camelCase")] 20pub struct Send<'a> { 21 /// The user to send the message to. 22 #[serde(borrow)] 23 pub did: jacquard_common::CowStr<'a>, 24 /// The message to send to the user. 25 #[serde(borrow)] 26 pub message: jacquard_common::CowStr<'a>, 27} 28 29#[jacquard_derive::lexicon] 30#[derive( 31 serde::Serialize, 32 serde::Deserialize, 33 Debug, 34 Clone, 35 PartialEq, 36 Eq, 37 jacquard_derive::IntoStatic 38)] 39#[serde(rename_all = "camelCase")] 40pub struct SendOutput<'a> { 41 /// Whether the token was successfully registered. 42 pub success: bool, 43} 44 45///Response type for 46///app.ocho.message.send 47pub struct SendResponse; 48impl jacquard_common::xrpc::XrpcResp for SendResponse { 49 const NSID: &'static str = "app.ocho.message.send"; 50 const ENCODING: &'static str = "application/json"; 51 type Output<'de> = SendOutput<'de>; 52 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 53} 54 55impl<'a> jacquard_common::xrpc::XrpcRequest for Send<'a> { 56 const NSID: &'static str = "app.ocho.message.send"; 57 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 58 "application/json", 59 ); 60 type Response = SendResponse; 61} 62 63///Endpoint type for 64///app.ocho.message.send 65pub struct SendRequest; 66impl jacquard_common::xrpc::XrpcEndpoint for SendRequest { 67 const PATH: &'static str = "/xrpc/app.ocho.message.send"; 68 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 69 "application/json", 70 ); 71 type Request<'de> = Send<'de>; 72 type Response = SendResponse; 73}