proto-blue-api 0.3.3

AT Protocol high-level API: agent, rich text, moderation, generated types
Documentation
// Generated by atproto-codegen. Do not edit.
//! Lexicon: app.bsky.feed.threadgate
#![allow(clippy::pedantic, clippy::nursery, clippy::all)]

use serde::{Deserialize, Serialize};

/// Allow replies from actors who follow you.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FollowerRule {}

/// Allow replies from actors you follow.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FollowingRule {}

/// Allow replies from actors on a list.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ListRule {
    pub list: proto_blue_syntax::AtUri,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum MainAllowItemRefs {
    #[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
    BskyFeedThreadgateMentionRule(Box<MentionRule>),
    #[serde(rename = "app.bsky.feed.threadgate#followerRule")]
    BskyFeedThreadgateFollowerRule(Box<FollowerRule>),
    #[serde(rename = "app.bsky.feed.threadgate#followingRule")]
    BskyFeedThreadgateFollowingRule(Box<FollowingRule>),
    #[serde(rename = "app.bsky.feed.threadgate#listRule")]
    BskyFeedThreadgateListRule(Box<ListRule>),
    #[serde(other)]
    Other,
}

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

#[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,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allow: Option<Vec<MainAllowItemRefs>>,
    pub created_at: proto_blue_syntax::Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hidden_replies: Option<Vec<proto_blue_syntax::AtUri>>,
    pub post: proto_blue_syntax::AtUri,
}

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

/// Allow replies from actors mentioned in your post.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MentionRule {}