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