jacquard_api/app_bsky/contact/
remove_data.rs1#[allow(unused_imports)]
9use alloc::collections::BTreeMap;
10
11#[allow(unused_imports)]
12use core::marker::PhantomData;
13use jacquard_common::CowStr;
14use jacquard_derive::{IntoStatic, lexicon, open_union};
15use serde::{Serialize, Deserialize};
16
17#[lexicon]
18#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
19#[serde(rename_all = "camelCase")]
20pub struct RemoveData<'a> {}
21
22#[lexicon]
23#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
24#[serde(rename_all = "camelCase")]
25pub struct RemoveDataOutput<'a> {}
26
27#[open_union]
28#[derive(
29 Serialize,
30 Deserialize,
31 Debug,
32 Clone,
33 PartialEq,
34 Eq,
35 thiserror::Error,
36 miette::Diagnostic,
37 IntoStatic
38)]
39
40#[serde(tag = "error", content = "message")]
41#[serde(bound(deserialize = "'de: 'a"))]
42pub enum RemoveDataError<'a> {
43 #[serde(rename = "InvalidDid")]
44 InvalidDid(Option<CowStr<'a>>),
45 #[serde(rename = "InternalError")]
46 InternalError(Option<CowStr<'a>>),
47}
48
49impl core::fmt::Display for RemoveDataError<'_> {
50 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
51 match self {
52 Self::InvalidDid(msg) => {
53 write!(f, "InvalidDid")?;
54 if let Some(msg) = msg {
55 write!(f, ": {}", msg)?;
56 }
57 Ok(())
58 }
59 Self::InternalError(msg) => {
60 write!(f, "InternalError")?;
61 if let Some(msg) = msg {
62 write!(f, ": {}", msg)?;
63 }
64 Ok(())
65 }
66 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
67 }
68 }
69}
70
71pub struct RemoveDataResponse;
73impl jacquard_common::xrpc::XrpcResp for RemoveDataResponse {
74 const NSID: &'static str = "app.bsky.contact.removeData";
75 const ENCODING: &'static str = "application/json";
76 type Output<'de> = RemoveDataOutput<'de>;
77 type Err<'de> = RemoveDataError<'de>;
78}
79
80impl<'a> jacquard_common::xrpc::XrpcRequest for RemoveData<'a> {
81 const NSID: &'static str = "app.bsky.contact.removeData";
82 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
83 "application/json",
84 );
85 type Response = RemoveDataResponse;
86}
87
88pub struct RemoveDataRequest;
90impl jacquard_common::xrpc::XrpcEndpoint for RemoveDataRequest {
91 const PATH: &'static str = "/xrpc/app.bsky.contact.removeData";
92 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
93 "application/json",
94 );
95 type Request<'de> = RemoveData<'de>;
96 type Response = RemoveDataResponse;
97}