jacquard_api/app_ocho/message/
send.rs

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    bon::Builder,
17    jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20#[builder(start_fn = new)]
21pub struct Send<'a> {
22    ///The user to send the message to.
23    #[serde(borrow)]
24    #[builder(into)]
25    pub did: jacquard_common::CowStr<'a>,
26    ///The message to send to the user.
27    #[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    ///Whether the token was successfully registered.
52    pub success: bool,
53}
54
55///Response type for
56///app.ocho.message.send
57pub 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
73///Endpoint type for
74///app.ocho.message.send
75pub 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}