// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: tools.ozone.set.getValues // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, bon::Builder )] #[builder(start_fn = new)] #[serde(rename_all = "camelCase")] pub struct GetValues<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub cursor: std::option::Option>, ///(default: 100, min: 1, max: 1000) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub limit: std::option::Option, #[serde(borrow)] #[builder(into)] pub name: jacquard_common::CowStr<'a>, } impl jacquard_common::IntoStatic for GetValues<'_> { type Output = GetValues<'static>; fn into_static(self) -> Self::Output { GetValues { cursor: self.cursor.into_static(), limit: self.limit.into_static(), name: self.name.into_static(), } } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetValuesOutput<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cursor: std::option::Option>, #[serde(borrow)] pub set: crate::tools_ozone::set::SetView<'a>, #[serde(borrow)] pub values: Vec>, } impl jacquard_common::IntoStatic for GetValuesOutput<'_> { type Output = GetValuesOutput<'static>; fn into_static(self) -> Self::Output { GetValuesOutput { cursor: self.cursor.into_static(), set: self.set.into_static(), values: self.values.into_static(), 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 GetValuesError<'a> { ///set with the given name does not exist #[serde(rename = "SetNotFound")] SetNotFound(std::option::Option), } impl std::fmt::Display for GetValuesError<'_> { 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 GetValuesError<'_> { type Output = GetValuesError<'static>; fn into_static(self) -> Self::Output { match self { GetValuesError::SetNotFound(v) => { GetValuesError::SetNotFound(v.into_static()) } GetValuesError::Unknown(v) => GetValuesError::Unknown(v.into_static()), } } } impl jacquard_common::types::xrpc::XrpcRequest for GetValues<'_> { const NSID: &'static str = "tools.ozone.set.getValues"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetValuesOutput<'de>; type Err<'de> = GetValuesError<'de>; }