A better Rust ATProto crate
at main 4.0 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.feed.getAuthorFeed 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 GetAuthorFeed<'a> { 21 #[serde(borrow)] 22 pub actor: jacquard_common::types::ident::AtIdentifier<'a>, 23 #[serde(skip_serializing_if = "std::option::Option::is_none")] 24 #[serde(borrow)] 25 #[builder(into)] 26 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 27 ///(default: "posts_with_replies") 28 #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 #[serde(borrow)] 30 #[builder(into)] 31 pub filter: std::option::Option<jacquard_common::CowStr<'a>>, 32 ///(default: false) 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 pub include_pins: std::option::Option<bool>, 35 ///(default: 50, min: 1, max: 100) 36 #[serde(skip_serializing_if = "std::option::Option::is_none")] 37 pub limit: std::option::Option<i64>, 38} 39 40#[jacquard_derive::lexicon] 41#[derive( 42 serde::Serialize, 43 serde::Deserialize, 44 Debug, 45 Clone, 46 PartialEq, 47 Eq, 48 jacquard_derive::IntoStatic 49)] 50#[serde(rename_all = "camelCase")] 51pub struct GetAuthorFeedOutput<'a> { 52 #[serde(skip_serializing_if = "std::option::Option::is_none")] 53 #[serde(borrow)] 54 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 55 #[serde(borrow)] 56 pub feed: Vec<crate::app_bsky::feed::FeedViewPost<'a>>, 57} 58 59#[jacquard_derive::open_union] 60#[derive( 61 serde::Serialize, 62 serde::Deserialize, 63 Debug, 64 Clone, 65 PartialEq, 66 Eq, 67 thiserror::Error, 68 miette::Diagnostic, 69 jacquard_derive::IntoStatic 70)] 71#[serde(tag = "error", content = "message")] 72#[serde(bound(deserialize = "'de: 'a"))] 73pub enum GetAuthorFeedError<'a> { 74 #[serde(rename = "BlockedActor")] 75 BlockedActor(std::option::Option<String>), 76 #[serde(rename = "BlockedByActor")] 77 BlockedByActor(std::option::Option<String>), 78} 79 80impl std::fmt::Display for GetAuthorFeedError<'_> { 81 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 82 match self { 83 Self::BlockedActor(msg) => { 84 write!(f, "BlockedActor")?; 85 if let Some(msg) = msg { 86 write!(f, ": {}", msg)?; 87 } 88 Ok(()) 89 } 90 Self::BlockedByActor(msg) => { 91 write!(f, "BlockedByActor")?; 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 102///Response type for 103///app.bsky.feed.getAuthorFeed 104pub struct GetAuthorFeedResponse; 105impl jacquard_common::xrpc::XrpcResp for GetAuthorFeedResponse { 106 const NSID: &'static str = "app.bsky.feed.getAuthorFeed"; 107 const ENCODING: &'static str = "application/json"; 108 type Output<'de> = GetAuthorFeedOutput<'de>; 109 type Err<'de> = GetAuthorFeedError<'de>; 110} 111 112impl<'a> jacquard_common::xrpc::XrpcRequest for GetAuthorFeed<'a> { 113 const NSID: &'static str = "app.bsky.feed.getAuthorFeed"; 114 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 115 type Response = GetAuthorFeedResponse; 116} 117 118///Endpoint type for 119///app.bsky.feed.getAuthorFeed 120pub struct GetAuthorFeedRequest; 121impl jacquard_common::xrpc::XrpcEndpoint for GetAuthorFeedRequest { 122 const PATH: &'static str = "/xrpc/app.bsky.feed.getAuthorFeed"; 123 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 124 type Request<'de> = GetAuthorFeed<'de>; 125 type Response = GetAuthorFeedResponse; 126}