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