1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: tools.ozone.set.deleteSet
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 DeleteSet<'a> {
22 ///Name of the set to delete
23 #[serde(borrow)]
24 #[builder(into)]
25 pub name: jacquard_common::CowStr<'a>,
26 #[serde(flatten)]
27 #[serde(borrow)]
28 #[builder(default)]
29 pub extra_data: ::std::collections::BTreeMap<
30 ::jacquard_common::smol_str::SmolStr,
31 ::jacquard_common::types::value::Data<'a>,
32 >,
33}
34
35#[jacquard_derive::lexicon]
36#[derive(
37 serde::Serialize,
38 serde::Deserialize,
39 Debug,
40 Clone,
41 PartialEq,
42 Eq,
43 jacquard_derive::IntoStatic
44)]
45#[serde(rename_all = "camelCase")]
46pub struct DeleteSetOutput<'a> {}
47#[jacquard_derive::open_union]
48#[derive(
49 serde::Serialize,
50 serde::Deserialize,
51 Debug,
52 Clone,
53 PartialEq,
54 Eq,
55 thiserror::Error,
56 miette::Diagnostic,
57 jacquard_derive::IntoStatic
58)]
59#[serde(tag = "error", content = "message")]
60#[serde(bound(deserialize = "'de: 'a"))]
61pub enum DeleteSetError<'a> {
62 ///set with the given name does not exist
63 #[serde(rename = "SetNotFound")]
64 SetNotFound(std::option::Option<String>),
65}
66
67impl std::fmt::Display for DeleteSetError<'_> {
68 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
69 match self {
70 Self::SetNotFound(msg) => {
71 write!(f, "SetNotFound")?;
72 if let Some(msg) = msg {
73 write!(f, ": {}", msg)?;
74 }
75 Ok(())
76 }
77 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
78 }
79 }
80}
81
82///Response type for
83///tools.ozone.set.deleteSet
84pub struct DeleteSetResponse;
85impl jacquard_common::xrpc::XrpcResp for DeleteSetResponse {
86 const NSID: &'static str = "tools.ozone.set.deleteSet";
87 const ENCODING: &'static str = "application/json";
88 type Output<'de> = DeleteSetOutput<'de>;
89 type Err<'de> = DeleteSetError<'de>;
90}
91
92impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteSet<'a> {
93 const NSID: &'static str = "tools.ozone.set.deleteSet";
94 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
95 "application/json",
96 );
97 type Response = DeleteSetResponse;
98}
99
100///Endpoint type for
101///tools.ozone.set.deleteSet
102pub struct DeleteSetRequest;
103impl jacquard_common::xrpc::XrpcEndpoint for DeleteSetRequest {
104 const PATH: &'static str = "/xrpc/tools.ozone.set.deleteSet";
105 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
106 "application/json",
107 );
108 type Request<'de> = DeleteSet<'de>;
109 type Response = DeleteSetResponse;
110}