Skip to main content

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

1// Generated by atproto-codegen. Do not edit.
2//! Lexicon: app.bsky.feed.post
3#![allow(clippy::pedantic, clippy::nursery, clippy::all)]
4
5use serde::{Deserialize, Serialize};
6
7/// Deprecated: use facets instead.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct Entity {
11    pub index: TextSlice,
12    #[serde(rename = "type")]
13    pub r#type: String,
14    pub value: String,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(tag = "$type")]
19pub enum MainEmbedRefs {
20    #[serde(rename = "app.bsky.embed.images")]
21    BskyEmbedImages(Box<crate::app::bsky::embed::images::Main>),
22    #[serde(rename = "app.bsky.embed.video")]
23    BskyEmbedVideo(Box<crate::app::bsky::embed::video::Main>),
24    #[serde(rename = "app.bsky.embed.external")]
25    BskyEmbedExternal(Box<crate::app::bsky::embed::external::Main>),
26    #[serde(rename = "app.bsky.embed.record")]
27    BskyEmbedRecord(Box<crate::app::bsky::embed::record::Main>),
28    #[serde(rename = "app.bsky.embed.recordWithMedia")]
29    BskyEmbedRecordWithMedia(Box<crate::app::bsky::embed::record_with_media::Main>),
30    #[serde(other)]
31    Other,
32}
33
34/// Self-label values for this post. Effectively content warnings.
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(tag = "$type")]
37pub enum MainLabelsRefs {
38    #[serde(rename = "com.atproto.label.defs#selfLabels")]
39    AtprotoLabelDefsSelfLabels(Box<crate::com::atproto::label::defs::SelfLabels>),
40    #[serde(other)]
41    Other,
42}
43
44/// `$type` discriminator for this record on the wire.
45pub const TYPE: &str = "app.bsky.feed.post";
46
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(rename_all = "camelCase")]
49pub struct Main {
50    /// The `$type` discriminator. Defaults to [`TYPE`] on construction.
51    #[serde(rename = "$type", default = "default_type")]
52    pub r#type: String,
53    pub created_at: proto_blue_syntax::Datetime,
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub embed: Option<MainEmbedRefs>,
56    #[serde(skip_serializing_if = "Option::is_none")]
57    pub entities: Option<Vec<Entity>>,
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub labels: Option<MainLabelsRefs>,
62    #[serde(skip_serializing_if = "Option::is_none")]
63    pub langs: Option<Vec<String>>,
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub reply: Option<ReplyRef>,
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub tags: Option<Vec<String>>,
68    pub text: String,
69}
70
71fn default_type() -> String {
72    TYPE.to_string()
73}
74
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(rename_all = "camelCase")]
77pub struct ReplyRef {
78    pub parent: crate::com::atproto::repo::strong_ref::Main,
79    pub root: crate::com::atproto::repo::strong_ref::Main,
80}
81
82/// Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.
83#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(rename_all = "camelCase")]
85pub struct TextSlice {
86    pub end: i64,
87    pub start: i64,
88}