A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.set.getValues 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 bon::Builder, 16 jacquard_derive::IntoStatic 17)] 18#[builder(start_fn = new)] 19#[serde(rename_all = "camelCase")] 20pub struct GetValues<'a> { 21 #[serde(skip_serializing_if = "std::option::Option::is_none")] 22 #[serde(borrow)] 23 #[builder(into)] 24 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 25 ///(default: 100, min: 1, max: 1000) 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 pub limit: std::option::Option<i64>, 28 #[serde(borrow)] 29 #[builder(into)] 30 pub name: jacquard_common::CowStr<'a>, 31} 32 33#[jacquard_derive::lexicon] 34#[derive( 35 serde::Serialize, 36 serde::Deserialize, 37 Debug, 38 Clone, 39 PartialEq, 40 Eq, 41 jacquard_derive::IntoStatic 42)] 43#[serde(rename_all = "camelCase")] 44pub struct GetValuesOutput<'a> { 45 #[serde(skip_serializing_if = "std::option::Option::is_none")] 46 #[serde(borrow)] 47 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 48 #[serde(borrow)] 49 pub set: crate::tools_ozone::set::SetView<'a>, 50 #[serde(borrow)] 51 pub values: Vec<jacquard_common::CowStr<'a>>, 52} 53 54#[jacquard_derive::open_union] 55#[derive( 56 serde::Serialize, 57 serde::Deserialize, 58 Debug, 59 Clone, 60 PartialEq, 61 Eq, 62 thiserror::Error, 63 miette::Diagnostic, 64 jacquard_derive::IntoStatic 65)] 66#[serde(tag = "error", content = "message")] 67#[serde(bound(deserialize = "'de: 'a"))] 68pub enum GetValuesError<'a> { 69 /// set with the given name does not exist 70 #[serde(rename = "SetNotFound")] 71 SetNotFound(std::option::Option<String>), 72} 73 74impl std::fmt::Display for GetValuesError<'_> { 75 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 76 match self { 77 Self::SetNotFound(msg) => { 78 write!(f, "SetNotFound")?; 79 if let Some(msg) = msg { 80 write!(f, ": {}", msg)?; 81 } 82 Ok(()) 83 } 84 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 85 } 86 } 87} 88 89///Response type for 90///tools.ozone.set.getValues 91pub struct GetValuesResponse; 92impl jacquard_common::xrpc::XrpcResp for GetValuesResponse { 93 const NSID: &'static str = "tools.ozone.set.getValues"; 94 const ENCODING: &'static str = "application/json"; 95 type Output<'de> = GetValuesOutput<'de>; 96 type Err<'de> = GetValuesError<'de>; 97} 98 99impl<'a> jacquard_common::xrpc::XrpcRequest for GetValues<'a> { 100 const NSID: &'static str = "tools.ozone.set.getValues"; 101 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 102 type Response = GetValuesResponse; 103} 104 105///Endpoint type for 106///tools.ozone.set.getValues 107pub struct GetValuesRequest; 108impl jacquard_common::xrpc::XrpcEndpoint for GetValuesRequest { 109 const PATH: &'static str = "/xrpc/tools.ozone.set.getValues"; 110 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 111 type Request<'de> = GetValues<'de>; 112 type Response = GetValuesResponse; 113}