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)]
58#[serde(tag = "error", content = "message")]
59#[serde(bound(deserialize = "'de: 'a"))]
60pub enum DeleteSetError<'a> {
61 ///set with the given name does not exist
62 #[serde(rename = "SetNotFound")]
63 SetNotFound(std::option::Option<String>),
64}
65
66impl std::fmt::Display for DeleteSetError<'_> {
67 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
68 match self {
69 Self::SetNotFound(msg) => {
70 write!(f, "SetNotFound")?;
71 if let Some(msg) = msg {
72 write!(f, ": {}", msg)?;
73 }
74 Ok(())
75 }
76 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
77 }
78 }
79}
80
81impl jacquard_common::IntoStatic for DeleteSetError<'_> {
82 type Output = DeleteSetError<'static>;
83 fn into_static(self) -> Self::Output {
84 match self {
85 DeleteSetError::SetNotFound(v) => {
86 DeleteSetError::SetNotFound(v.into_static())
87 }
88 DeleteSetError::Unknown(v) => DeleteSetError::Unknown(v.into_static()),
89 }
90 }
91}
92
93///Response type for
94///tools.ozone.set.deleteSet
95pub struct DeleteSetResponse;
96impl jacquard_common::xrpc::XrpcResp for DeleteSetResponse {
97 const NSID: &'static str = "tools.ozone.set.deleteSet";
98 const ENCODING: &'static str = "application/json";
99 type Output<'de> = DeleteSetOutput<'de>;
100 type Err<'de> = DeleteSetError<'de>;
101}
102
103impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for DeleteSet<'de> {
104 const NSID: &'static str = "tools.ozone.set.deleteSet";
105 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
106 "application/json",
107 );
108 type Response = DeleteSetResponse;
109}