Skip to main content

proto_blue_api/generated/app/bsky/feed/
threadgate.rs

1// Generated by atproto-codegen. Do not edit.
2//! Lexicon: app.bsky.feed.threadgate
3#![allow(clippy::pedantic, clippy::nursery, clippy::all)]
4
5use serde::{Deserialize, Serialize};
6
7/// Allow replies from actors who follow you.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct FollowerRule {}
11
12/// Allow replies from actors you follow.
13#[derive(Debug, Clone, Serialize, Deserialize)]
14#[serde(rename_all = "camelCase")]
15pub struct FollowingRule {}
16
17/// Allow replies from actors on a list.
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(rename_all = "camelCase")]
20pub struct ListRule {
21    pub list: proto_blue_syntax::AtUri,
22}
23
24#[derive(Debug, Clone, Serialize, Deserialize)]
25#[serde(tag = "$type")]
26pub enum MainAllowItemRefs {
27    #[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
28    BskyFeedThreadgateMentionRule(Box<MentionRule>),
29    #[serde(rename = "app.bsky.feed.threadgate#followerRule")]
30    BskyFeedThreadgateFollowerRule(Box<FollowerRule>),
31    #[serde(rename = "app.bsky.feed.threadgate#followingRule")]
32    BskyFeedThreadgateFollowingRule(Box<FollowingRule>),
33    #[serde(rename = "app.bsky.feed.threadgate#listRule")]
34    BskyFeedThreadgateListRule(Box<ListRule>),
35    #[serde(other)]
36    Other,
37}
38
39/// `$type` discriminator for this record on the wire.
40pub const TYPE: &str = "app.bsky.feed.threadgate";
41
42#[derive(Debug, Clone, Serialize, Deserialize)]
43#[serde(rename_all = "camelCase")]
44pub struct Main {
45    /// The `$type` discriminator. Defaults to [`TYPE`] on construction.
46    #[serde(rename = "$type", default = "default_type")]
47    pub r#type: String,
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub allow: Option<Vec<MainAllowItemRefs>>,
50    pub created_at: proto_blue_syntax::Datetime,
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub hidden_replies: Option<Vec<proto_blue_syntax::AtUri>>,
53    pub post: proto_blue_syntax::AtUri,
54}
55
56fn default_type() -> String {
57    TYPE.to_string()
58}
59
60/// Allow replies from actors mentioned in your post.
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub struct MentionRule {}