// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: tools.ozone.set.deleteSet // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, bon::Builder )] #[serde(rename_all = "camelCase")] #[builder(start_fn = new)] pub struct DeleteSet<'a> { ///Name of the set to delete #[serde(borrow)] #[builder(into)] pub name: jacquard_common::CowStr<'a>, #[serde(flatten)] #[serde(borrow)] #[builder(default)] pub extra_data: ::std::collections::BTreeMap< ::jacquard_common::smol_str::SmolStr, ::jacquard_common::types::value::Data<'a>, >, } impl jacquard_common::IntoStatic for DeleteSet<'_> { type Output = DeleteSet<'static>; fn into_static(self) -> Self::Output { DeleteSet { name: self.name.into_static(), extra_data: self.extra_data.into_static(), } } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct DeleteSetOutput<'a> {} impl jacquard_common::IntoStatic for DeleteSetOutput<'_> { type Output = DeleteSetOutput<'static>; fn into_static(self) -> Self::Output { DeleteSetOutput { extra_data: self.extra_data.into_static(), } } } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum DeleteSetError<'a> { ///set with the given name does not exist #[serde(rename = "SetNotFound")] SetNotFound(std::option::Option), } impl std::fmt::Display for DeleteSetError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::SetNotFound(msg) => { write!(f, "SetNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } impl jacquard_common::IntoStatic for DeleteSetError<'_> { type Output = DeleteSetError<'static>; fn into_static(self) -> Self::Output { match self { DeleteSetError::SetNotFound(v) => { DeleteSetError::SetNotFound(v.into_static()) } DeleteSetError::Unknown(v) => DeleteSetError::Unknown(v.into_static()), } } } impl jacquard_common::types::xrpc::XrpcRequest for DeleteSet<'_> { const NSID: &'static str = "tools.ozone.set.deleteSet"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( "application/json", ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = DeleteSetOutput<'de>; type Err<'de> = DeleteSetError<'de>; }