jacquard_api/app_ocho/message/
send.rs1#[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 Send<'a> {
22 #[serde(borrow)]
24 #[builder(into)]
25 pub did: jacquard_common::CowStr<'a>,
26 #[serde(borrow)]
28 #[builder(into)]
29 pub message: jacquard_common::CowStr<'a>,
30 #[serde(flatten)]
31 #[serde(borrow)]
32 #[builder(default)]
33 pub extra_data: ::std::collections::BTreeMap<
34 ::jacquard_common::smol_str::SmolStr,
35 ::jacquard_common::types::value::Data<'a>,
36 >,
37}
38
39#[jacquard_derive::lexicon]
40#[derive(
41 serde::Serialize,
42 serde::Deserialize,
43 Debug,
44 Clone,
45 PartialEq,
46 Eq,
47 jacquard_derive::IntoStatic
48)]
49#[serde(rename_all = "camelCase")]
50pub struct SendOutput<'a> {
51 pub success: bool,
53}
54
55pub struct SendResponse;
58impl jacquard_common::xrpc::XrpcResp for SendResponse {
59 const NSID: &'static str = "app.ocho.message.send";
60 const ENCODING: &'static str = "application/json";
61 type Output<'de> = SendOutput<'de>;
62 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
63}
64
65impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for Send<'de> {
66 const NSID: &'static str = "app.ocho.message.send";
67 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
68 "application/json",
69 );
70 type Response = SendResponse;
71}
72
73pub struct SendRequest;
76impl jacquard_common::xrpc::XrpcEndpoint for SendRequest {
77 const PATH: &'static str = "/xrpc/app.ocho.message.send";
78 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
79 "application/json",
80 );
81 type Request<'de> = Send<'de>;
82 type Response = SendResponse;
83}