A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.set.deleteValues 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(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 10#[serde(rename_all = "camelCase")] 11pub struct DeleteValues<'a> { 12 ///Name of the set to delete values from 13 #[serde(borrow)] 14 pub name: jacquard_common::CowStr<'a>, 15 ///Array of string values to delete from the set 16 #[serde(borrow)] 17 pub values: Vec<jacquard_common::CowStr<'a>>, 18} 19 20impl jacquard_common::IntoStatic for DeleteValues<'_> { 21 type Output = DeleteValues<'static>; 22 fn into_static(self) -> Self::Output { 23 DeleteValues { 24 name: self.name.into_static(), 25 values: self.values.into_static(), 26 extra_data: self.extra_data.into_static(), 27 } 28 } 29} 30 31#[jacquard_derive::open_union] 32#[derive( 33 serde::Serialize, 34 serde::Deserialize, 35 Debug, 36 Clone, 37 PartialEq, 38 Eq, 39 thiserror::Error, 40 miette::Diagnostic 41)] 42#[serde(tag = "error", content = "message")] 43#[serde(bound(deserialize = "'de: 'a"))] 44pub enum DeleteValuesError<'a> { 45 ///set with the given name does not exist 46 #[serde(rename = "SetNotFound")] 47 SetNotFound(std::option::Option<String>), 48} 49 50impl std::fmt::Display for DeleteValuesError<'_> { 51 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 52 match self { 53 Self::SetNotFound(msg) => { 54 write!(f, "SetNotFound")?; 55 if let Some(msg) = msg { 56 write!(f, ": {}", msg)?; 57 } 58 Ok(()) 59 } 60 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 61 } 62 } 63} 64 65impl jacquard_common::IntoStatic for DeleteValuesError<'_> { 66 type Output = DeleteValuesError<'static>; 67 fn into_static(self) -> Self::Output { 68 match self { 69 DeleteValuesError::SetNotFound(v) => { 70 DeleteValuesError::SetNotFound(v.into_static()) 71 } 72 DeleteValuesError::Unknown(v) => DeleteValuesError::Unknown(v.into_static()), 73 } 74 } 75} 76 77impl jacquard_common::types::xrpc::XrpcRequest for DeleteValues<'_> { 78 const NSID: &'static str = "tools.ozone.set.deleteValues"; 79 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( 80 "application/json", 81 ); 82 const OUTPUT_ENCODING: &'static str = "application/json"; 83 type Output<'de> = (); 84 type Err<'de> = DeleteValuesError<'de>; 85}