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/// `$type` discriminator for this record on the wire.
17pub const TYPE: &str = "app.bsky.feed.post";
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(rename_all = "camelCase")]
21pub struct Main {
22    /// The `$type` discriminator. Defaults to [`TYPE`] on construction.
23    #[serde(rename = "$type", default = "default_type")]
24    pub r#type: String,
25    pub created_at: String,
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub embed: Option<serde_json::Value>,
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub entities: Option<Vec<Entity>>,
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub labels: Option<serde_json::Value>,
34    #[serde(skip_serializing_if = "Option::is_none")]
35    pub langs: Option<Vec<String>>,
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub reply: Option<ReplyRef>,
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub tags: Option<Vec<String>>,
40    pub text: String,
41}
42
43fn default_type() -> String {
44    TYPE.to_string()
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(rename_all = "camelCase")]
49pub struct ReplyRef {
50    pub parent: crate::com::atproto::repo::strong_ref::Main,
51    pub root: crate::com::atproto::repo::strong_ref::Main,
52}
53
54/// Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.
55#[derive(Debug, Clone, Serialize, Deserialize)]
56#[serde(rename_all = "camelCase")]
57pub struct TextSlice {
58    pub end: i64,
59    pub start: i64,
60}