Skip to main content

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