// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: app.bsky.unspecced.getPostThreadV2 // // 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 GetPostThreadV2<'a> { ///(default: true) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub above: std::option::Option, #[serde(borrow)] pub anchor: jacquard_common::types::string::AtUri<'a>, ///(default: 6, min: 0, max: 20) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub below: std::option::Option, ///(default: 10, min: 0, max: 100) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub branching_factor: std::option::Option, ///(default: false) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub prioritize_followed_users: std::option::Option, ///(default: "oldest") #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub sort: std::option::Option>, } impl jacquard_common::IntoStatic for GetPostThreadV2<'_> { type Output = GetPostThreadV2<'static>; fn into_static(self) -> Self::Output { GetPostThreadV2 { above: self.above.into_static(), anchor: self.anchor.into_static(), below: self.below.into_static(), branching_factor: self.branching_factor.into_static(), prioritize_followed_users: self.prioritize_followed_users.into_static(), sort: self.sort.into_static(), } } } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetPostThreadV2Output<'a> { ///Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. pub has_other_replies: bool, ///A flat list of thread items. The depth of each item is indicated by the depth property inside the item. #[serde(borrow)] pub thread: Vec>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub threadgate: std::option::Option>, } impl jacquard_common::IntoStatic for GetPostThreadV2Output<'_> { type Output = GetPostThreadV2Output<'static>; fn into_static(self) -> Self::Output { GetPostThreadV2Output { has_other_replies: self.has_other_replies.into_static(), thread: self.thread.into_static(), threadgate: self.threadgate.into_static(), extra_data: self.extra_data.into_static(), } } } impl jacquard_common::types::xrpc::XrpcRequest for GetPostThreadV2<'_> { const NSID: &'static str = "app.bsky.unspecced.getPostThreadV2"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPostThreadV2Output<'de>; type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ThreadItem<'a> { ///The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. pub depth: i64, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(borrow)] pub value: ThreadItemRecordValue<'a>, } #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ThreadItemRecordValue<'a> { #[serde(rename = "app.bsky.unspecced.defs#threadItemPost")] DefsThreadItemPost(Box>), #[serde(rename = "app.bsky.unspecced.defs#threadItemNoUnauthenticated")] DefsThreadItemNoUnauthenticated( Box>, ), #[serde(rename = "app.bsky.unspecced.defs#threadItemNotFound")] DefsThreadItemNotFound(Box>), #[serde(rename = "app.bsky.unspecced.defs#threadItemBlocked")] DefsThreadItemBlocked(Box>), } impl jacquard_common::IntoStatic for ThreadItemRecordValue<'_> { type Output = ThreadItemRecordValue<'static>; fn into_static(self) -> Self::Output { match self { ThreadItemRecordValue::DefsThreadItemPost(v) => { ThreadItemRecordValue::DefsThreadItemPost(v.into_static()) } ThreadItemRecordValue::DefsThreadItemNoUnauthenticated(v) => { ThreadItemRecordValue::DefsThreadItemNoUnauthenticated(v.into_static()) } ThreadItemRecordValue::DefsThreadItemNotFound(v) => { ThreadItemRecordValue::DefsThreadItemNotFound(v.into_static()) } ThreadItemRecordValue::DefsThreadItemBlocked(v) => { ThreadItemRecordValue::DefsThreadItemBlocked(v.into_static()) } ThreadItemRecordValue::Unknown(v) => { ThreadItemRecordValue::Unknown(v.into_static()) } } } } impl jacquard_common::IntoStatic for ThreadItem<'_> { type Output = ThreadItem<'static>; fn into_static(self) -> Self::Output { ThreadItem { depth: self.depth.into_static(), uri: self.uri.into_static(), value: self.value.into_static(), extra_data: self.extra_data.into_static(), } } }