atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.feed.searchPostsV2` namespace.
pub const NSID: &str = "app.bsky.feed.searchPostsV2";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ParametersData {
    ///Search the full index instead of the recent-post window.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub all_time: core::option::Option<bool>,
    ///Include posts by any of these authors. Handles are resolved to DIDs before searching.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub authors: core::option::Option<Vec<crate::types::string::AtIdentifier>>,
    ///Optional pagination cursor.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub cursor: core::option::Option<String>,
    ///Include posts that link to any of these domains.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub domains: core::option::Option<Vec<String>>,
    ///Include posts that embed any of these AT URIs.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embedded_at_uris: core::option::Option<Vec<String>>,
    ///Exclude posts by any of these authors. Handles are resolved to DIDs before searching.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_authors: core::option::Option<Vec<crate::types::string::AtIdentifier>>,
    ///Exclude posts that link to any of these domains.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_domains: core::option::Option<Vec<String>>,
    ///Exclude posts that embed any of these AT URIs.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_embedded_at_uris: core::option::Option<Vec<String>>,
    ///Exclude posts tagged with any of these hashtags. Do not include the hash (#) prefix.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_hashtags: core::option::Option<Vec<String>>,
    ///Exclude posts whose language matches any of these language codes.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_languages: core::option::Option<Vec<crate::types::string::Language>>,
    ///Exclude posts that mention any of these accounts. Handles are resolved to DIDs before searching.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_mentions: core::option::Option<Vec<crate::types::string::AtIdentifier>>,
    ///Exclude replies from results. Mutually exclusive with repliesOnly.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_replies: core::option::Option<bool>,
    ///Exclude posts that link to any of these URLs.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub exclude_urls: core::option::Option<Vec<String>>,
    ///Include only posts from accounts followed by the viewer.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub following: core::option::Option<bool>,
    ///Include only posts with media.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub has_media: core::option::Option<bool>,
    ///Include only posts with video.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub has_video: core::option::Option<bool>,
    ///Include posts tagged with any of these hashtags. Do not include the hash (#) prefix.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub hashtags: core::option::Option<Vec<String>>,
    ///Include posts whose language matches any of these language codes.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub languages: core::option::Option<Vec<crate::types::string::Language>>,
    ///Maximum number of results to return.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub limit: core::option::Option<crate::types::LimitedNonZeroU8<100u8>>,
    ///Include posts that mention any of these accounts. Handles are resolved to DIDs before searching.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub mentions: core::option::Option<Vec<crate::types::string::AtIdentifier>>,
    ///Search query string. A query or at least one filter is required.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub query: core::option::Option<String>,
    ///Language analyzer hint for the query text. If unset, the server auto-detects when possible.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub query_language: core::option::Option<String>,
    ///Include only replies. Mutually exclusive with excludeReplies.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub replies_only: core::option::Option<bool>,
    ///Include only direct replies to this parent post URI.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub reply_parent_uri: core::option::Option<String>,
    ///Include posts indexed at or after this timestamp. Can be a datetime, or just an ISO date (YYYY-MM-DD).
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub since: core::option::Option<String>,
    ///Ranking order for results. 'recent' sorts by recency; 'top' uses search ranking.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub sort: core::option::Option<String>,
    ///Include only posts in the thread rooted at this post URI.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub thread_root_uri: core::option::Option<String>,
    ///Include posts indexed before this timestamp. Defaults to the current time. Can be a datetime, or just an ISO date (YYYY-MM-DD).
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub until: core::option::Option<String>,
    ///Include posts that link to any of these URLs.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub urls: core::option::Option<Vec<String>>,
}
pub type Parameters = crate::types::Object<ParametersData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    ///Cursor for the next page of results.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub cursor: core::option::Option<String>,
    ///Query languages detected for CJK, Thai, or Arabic text. Empty or omitted for other scripts.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub detected_query_languages: core::option::Option<Vec<String>>,
    ///Estimated total number of matching hits. May be rounded or truncated.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub hits_total: core::option::Option<i64>,
    ///Hydrated views of matching posts.
    pub posts: Vec<crate::app::bsky::feed::defs::PostView>,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    BadQueryString(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::BadQueryString(msg) => {
                write!(_f, "BadQueryString")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}