jacquard_api/tools_ozone/set/
delete_set.rs

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