1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.feed.getFeed
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 GetFeed<'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 #[serde(borrow)]
26 pub feed: jacquard_common::types::string::AtUri<'a>,
27 ///(default: 50, min: 1, max: 100)
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 pub limit: std::option::Option<i64>,
30}
31
32#[jacquard_derive::lexicon]
33#[derive(
34 serde::Serialize,
35 serde::Deserialize,
36 Debug,
37 Clone,
38 PartialEq,
39 Eq,
40 jacquard_derive::IntoStatic
41)]
42#[serde(rename_all = "camelCase")]
43pub struct GetFeedOutput<'a> {
44 #[serde(skip_serializing_if = "std::option::Option::is_none")]
45 #[serde(borrow)]
46 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
47 #[serde(borrow)]
48 pub feed: Vec<crate::app_bsky::feed::FeedViewPost<'a>>,
49}
50
51#[jacquard_derive::open_union]
52#[derive(
53 serde::Serialize,
54 serde::Deserialize,
55 Debug,
56 Clone,
57 PartialEq,
58 Eq,
59 thiserror::Error,
60 miette::Diagnostic,
61 jacquard_derive::IntoStatic
62)]
63#[serde(tag = "error", content = "message")]
64#[serde(bound(deserialize = "'de: 'a"))]
65pub enum GetFeedError<'a> {
66 #[serde(rename = "UnknownFeed")]
67 UnknownFeed(std::option::Option<String>),
68}
69
70impl std::fmt::Display for GetFeedError<'_> {
71 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
72 match self {
73 Self::UnknownFeed(msg) => {
74 write!(f, "UnknownFeed")?;
75 if let Some(msg) = msg {
76 write!(f, ": {}", msg)?;
77 }
78 Ok(())
79 }
80 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
81 }
82 }
83}
84
85///Response type for
86///app.bsky.feed.getFeed
87pub struct GetFeedResponse;
88impl jacquard_common::xrpc::XrpcResp for GetFeedResponse {
89 const NSID: &'static str = "app.bsky.feed.getFeed";
90 const ENCODING: &'static str = "application/json";
91 type Output<'de> = GetFeedOutput<'de>;
92 type Err<'de> = GetFeedError<'de>;
93}
94
95impl<'a> jacquard_common::xrpc::XrpcRequest for GetFeed<'a> {
96 const NSID: &'static str = "app.bsky.feed.getFeed";
97 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
98 type Response = GetFeedResponse;
99}
100
101///Endpoint type for
102///app.bsky.feed.getFeed
103pub struct GetFeedRequest;
104impl jacquard_common::xrpc::XrpcEndpoint for GetFeedRequest {
105 const PATH: &'static str = "/xrpc/app.bsky.feed.getFeed";
106 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
107 type Request<'de> = GetFeed<'de>;
108 type Response = GetFeedResponse;
109}