// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: app.bsky.feed.searchPosts // // 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, jacquard_derive::IntoStatic )] #[builder(start_fn = new)] #[serde(rename_all = "camelCase")] pub struct SearchPosts<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub author: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub cursor: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub domain: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub lang: std::option::Option, ///(default: 25, min: 1, max: 100) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub limit: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub mentions: std::option::Option>, #[serde(borrow)] #[builder(into)] pub q: jacquard_common::CowStr<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub since: std::option::Option>, ///(default: "latest") #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub sort: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tag: std::option::Option>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] #[builder(into)] pub until: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub url: std::option::Option>, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct SearchPostsOutput<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cursor: std::option::Option>, /// Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub hits_total: std::option::Option, #[serde(borrow)] pub posts: Vec>, } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic, jacquard_derive::IntoStatic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum SearchPostsError<'a> { #[serde(rename = "BadQueryString")] BadQueryString(std::option::Option), } impl std::fmt::Display for SearchPostsError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::BadQueryString(msg) => { write!(f, "BadQueryString")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } ///Response type for ///app.bsky.feed.searchPosts pub struct SearchPostsResponse; impl jacquard_common::xrpc::XrpcResp for SearchPostsResponse { const NSID: &'static str = "app.bsky.feed.searchPosts"; const ENCODING: &'static str = "application/json"; type Output<'de> = SearchPostsOutput<'de>; type Err<'de> = SearchPostsError<'de>; } impl<'a> jacquard_common::xrpc::XrpcRequest for SearchPosts<'a> { const NSID: &'static str = "app.bsky.feed.searchPosts"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = SearchPostsResponse; } ///Endpoint type for ///app.bsky.feed.searchPosts pub struct SearchPostsRequest; impl jacquard_common::xrpc::XrpcEndpoint for SearchPostsRequest { const PATH: &'static str = "/xrpc/app.bsky.feed.searchPosts"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = SearchPosts<'de>; type Response = SearchPostsResponse; }