A better Rust ATProto crate
at oauth 4.0 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.feed.getFeedSkeleton 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)] 17#[builder(start_fn = new)] 18#[serde(rename_all = "camelCase")] 19pub struct GetFeedSkeleton<'a> { 20 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 #[serde(borrow)] 22 #[builder(into)] 23 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 24 #[serde(borrow)] 25 pub feed: jacquard_common::types::string::AtUri<'a>, 26 ///(default: 50, min: 1, max: 100) 27 #[serde(skip_serializing_if = "std::option::Option::is_none")] 28 pub limit: std::option::Option<i64>, 29} 30 31impl jacquard_common::IntoStatic for GetFeedSkeleton<'_> { 32 type Output = GetFeedSkeleton<'static>; 33 fn into_static(self) -> Self::Output { 34 GetFeedSkeleton { 35 cursor: self.cursor.into_static(), 36 feed: self.feed.into_static(), 37 limit: self.limit.into_static(), 38 } 39 } 40} 41 42#[jacquard_derive::lexicon] 43#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 44#[serde(rename_all = "camelCase")] 45pub struct GetFeedSkeletonOutput<'a> { 46 #[serde(skip_serializing_if = "std::option::Option::is_none")] 47 #[serde(borrow)] 48 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 49 #[serde(borrow)] 50 pub feed: Vec<crate::app_bsky::feed::SkeletonFeedPost<'a>>, 51 ///Unique identifier per request that may be passed back alongside interactions. 52 #[serde(skip_serializing_if = "std::option::Option::is_none")] 53 #[serde(borrow)] 54 pub req_id: std::option::Option<jacquard_common::CowStr<'a>>, 55} 56 57impl jacquard_common::IntoStatic for GetFeedSkeletonOutput<'_> { 58 type Output = GetFeedSkeletonOutput<'static>; 59 fn into_static(self) -> Self::Output { 60 GetFeedSkeletonOutput { 61 cursor: self.cursor.into_static(), 62 feed: self.feed.into_static(), 63 req_id: self.req_id.into_static(), 64 extra_data: self.extra_data.into_static(), 65 } 66 } 67} 68 69#[jacquard_derive::open_union] 70#[derive( 71 serde::Serialize, 72 serde::Deserialize, 73 Debug, 74 Clone, 75 PartialEq, 76 Eq, 77 thiserror::Error, 78 miette::Diagnostic 79)] 80#[serde(tag = "error", content = "message")] 81#[serde(bound(deserialize = "'de: 'a"))] 82pub enum GetFeedSkeletonError<'a> { 83 #[serde(rename = "UnknownFeed")] 84 UnknownFeed(std::option::Option<String>), 85} 86 87impl std::fmt::Display for GetFeedSkeletonError<'_> { 88 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 89 match self { 90 Self::UnknownFeed(msg) => { 91 write!(f, "UnknownFeed")?; 92 if let Some(msg) = msg { 93 write!(f, ": {}", msg)?; 94 } 95 Ok(()) 96 } 97 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 98 } 99 } 100} 101 102impl jacquard_common::IntoStatic for GetFeedSkeletonError<'_> { 103 type Output = GetFeedSkeletonError<'static>; 104 fn into_static(self) -> Self::Output { 105 match self { 106 GetFeedSkeletonError::UnknownFeed(v) => { 107 GetFeedSkeletonError::UnknownFeed(v.into_static()) 108 } 109 GetFeedSkeletonError::Unknown(v) => { 110 GetFeedSkeletonError::Unknown(v.into_static()) 111 } 112 } 113 } 114} 115 116impl jacquard_common::types::xrpc::XrpcRequest for GetFeedSkeleton<'_> { 117 const NSID: &'static str = "app.bsky.feed.getFeedSkeleton"; 118 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; 119 const OUTPUT_ENCODING: &'static str = "application/json"; 120 type Output<'de> = GetFeedSkeletonOutput<'de>; 121 type Err<'de> = GetFeedSkeletonError<'de>; 122}