proto-blue-api 0.3.0

AT Protocol high-level API: agent, rich text, moderation, generated types
Documentation
// Generated by atproto-codegen. Do not edit.
//! Lexicon: app.bsky.feed.postgate

use serde::{Deserialize, Serialize};

/// Disables embedding of this post.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DisableRule {}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum MainEmbeddingRulesItemRefs {
    #[serde(rename = "app.bsky.feed.postgate#disableRule")]
    BskyFeedPostgateDisableRule(Box<DisableRule>),
    #[serde(other)]
    Other,
}

/// `$type` discriminator for this record on the wire.
pub const TYPE: &str = "app.bsky.feed.postgate";

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Main {
    /// The `$type` discriminator. Defaults to [`TYPE`] on construction.
    #[serde(rename = "$type", default = "default_type")]
    pub r#type: String,
    pub created_at: proto_blue_syntax::Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub detached_embedding_uris: Option<Vec<proto_blue_syntax::AtUri>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embedding_rules: Option<Vec<MainEmbeddingRulesItemRefs>>,
    pub post: proto_blue_syntax::AtUri,
}

fn default_type() -> String {
    TYPE.to_string()
}