atrium_api/app/bsky/unspecced/
get_post_thread_v2.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.unspecced.getPostThreadV2` namespace.
3pub const NSID: &str = "app.bsky.unspecced.getPostThreadV2";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    ///Whether to include parents above the anchor.
8    #[serde(skip_serializing_if = "core::option::Option::is_none")]
9    pub above: core::option::Option<bool>,
10    ///Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post.
11    pub anchor: String,
12    ///How many levels of replies to include below the anchor.
13    #[serde(skip_serializing_if = "core::option::Option::is_none")]
14    pub below: core::option::Option<crate::types::LimitedU8<20u8>>,
15    ///Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated).
16    #[serde(skip_serializing_if = "core::option::Option::is_none")]
17    pub branching_factor: core::option::Option<crate::types::LimitedU8<100u8>>,
18    ///Whether to prioritize posts from followed users. It only has effect when the user is authenticated.
19    #[serde(skip_serializing_if = "core::option::Option::is_none")]
20    pub prioritize_followed_users: core::option::Option<bool>,
21    ///Sorting for the thread replies.
22    #[serde(skip_serializing_if = "core::option::Option::is_none")]
23    pub sort: core::option::Option<String>,
24}
25pub type Parameters = crate::types::Object<ParametersData>;
26#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
27#[serde(rename_all = "camelCase")]
28pub struct OutputData {
29    ///Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them.
30    pub has_other_replies: bool,
31    ///A flat list of thread items. The depth of each item is indicated by the depth property inside the item.
32    pub thread: Vec<ThreadItem>,
33    #[serde(skip_serializing_if = "core::option::Option::is_none")]
34    pub threadgate: core::option::Option<crate::app::bsky::feed::defs::ThreadgateView>,
35}
36pub type Output = crate::types::Object<OutputData>;
37#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
38#[serde(tag = "error", content = "message")]
39pub enum Error {}
40impl std::fmt::Display for Error {
41    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
42        Ok(())
43    }
44}
45#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
46#[serde(rename_all = "camelCase")]
47pub struct ThreadItemData {
48    ///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.
49    pub depth: i64,
50    pub uri: String,
51    pub value: crate::types::Union<ThreadItemValueRefs>,
52}
53pub type ThreadItem = crate::types::Object<ThreadItemData>;
54#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
55#[serde(tag = "$type")]
56pub enum ThreadItemValueRefs {
57    #[serde(rename = "app.bsky.unspecced.defs#threadItemPost")]
58    AppBskyUnspeccedDefsThreadItemPost(Box<crate::app::bsky::unspecced::defs::ThreadItemPost>),
59    #[serde(rename = "app.bsky.unspecced.defs#threadItemNoUnauthenticated")]
60    AppBskyUnspeccedDefsThreadItemNoUnauthenticated(
61        Box<crate::app::bsky::unspecced::defs::ThreadItemNoUnauthenticated>,
62    ),
63    #[serde(rename = "app.bsky.unspecced.defs#threadItemNotFound")]
64    AppBskyUnspeccedDefsThreadItemNotFound(
65        Box<crate::app::bsky::unspecced::defs::ThreadItemNotFound>,
66    ),
67    #[serde(rename = "app.bsky.unspecced.defs#threadItemBlocked")]
68    AppBskyUnspeccedDefsThreadItemBlocked(
69        Box<crate::app::bsky::unspecced::defs::ThreadItemBlocked>,
70    ),
71}