jacquard_api/net_anisota/feed/
draft.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: net.anisota.feed.draft
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8///Record containing a draft post that can be edited and later published as app.bsky.feed.post
9#[jacquard_derive::lexicon]
10#[derive(
11    serde::Serialize,
12    serde::Deserialize,
13    Debug,
14    Clone,
15    PartialEq,
16    Eq,
17    jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Draft<'a> {
21    ///Client-declared timestamp when this draft was originally created.
22    pub created_at: jacquard_common::types::string::Datetime,
23    #[serde(skip_serializing_if = "std::option::Option::is_none")]
24    #[serde(borrow)]
25    pub embed: std::option::Option<DraftRecordEmbed<'a>>,
26    ///Annotations of text (mentions, URLs, hashtags, etc)
27    #[serde(skip_serializing_if = "std::option::Option::is_none")]
28    #[serde(borrow)]
29    pub facets: std::option::Option<Vec<crate::app_bsky::richtext::facet::Facet<'a>>>,
30    ///Self-label values for this post. Effectively content warnings.
31    #[serde(skip_serializing_if = "std::option::Option::is_none")]
32    #[serde(borrow)]
33    pub labels: std::option::Option<DraftRecordLabels<'a>>,
34    ///Indicates human language of post primary text content.
35    #[serde(skip_serializing_if = "std::option::Option::is_none")]
36    pub langs: std::option::Option<Vec<jacquard_common::types::string::Language>>,
37    #[serde(skip_serializing_if = "std::option::Option::is_none")]
38    #[serde(borrow)]
39    pub reply: std::option::Option<crate::net_anisota::feed::draft::ReplyRef<'a>>,
40    ///Additional hashtags, in addition to any included in post text and facets.
41    #[serde(skip_serializing_if = "std::option::Option::is_none")]
42    #[serde(borrow)]
43    pub tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
44    ///The primary post content. May be an empty string, if there are embeds.
45    #[serde(borrow)]
46    pub text: jacquard_common::CowStr<'a>,
47    ///Client-declared timestamp when this draft was last updated.
48    #[serde(skip_serializing_if = "std::option::Option::is_none")]
49    pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
50}
51
52#[jacquard_derive::open_union]
53#[derive(
54    serde::Serialize,
55    serde::Deserialize,
56    Debug,
57    Clone,
58    PartialEq,
59    Eq,
60    jacquard_derive::IntoStatic
61)]
62#[serde(tag = "$type")]
63#[serde(bound(deserialize = "'de: 'a"))]
64pub enum DraftRecordEmbed<'a> {
65    #[serde(rename = "app.bsky.embed.images")]
66    Images(Box<crate::app_bsky::embed::images::Images<'a>>),
67    #[serde(rename = "app.bsky.embed.video")]
68    Video(Box<crate::app_bsky::embed::video::Video<'a>>),
69    #[serde(rename = "app.bsky.embed.external")]
70    External(Box<crate::app_bsky::embed::external::ExternalRecord<'a>>),
71    #[serde(rename = "app.bsky.embed.record")]
72    Record(Box<crate::app_bsky::embed::record::Record<'a>>),
73    #[serde(rename = "app.bsky.embed.recordWithMedia")]
74    RecordWithMedia(Box<crate::app_bsky::embed::record_with_media::RecordWithMedia<'a>>),
75}
76
77#[jacquard_derive::open_union]
78#[derive(
79    serde::Serialize,
80    serde::Deserialize,
81    Debug,
82    Clone,
83    PartialEq,
84    Eq,
85    jacquard_derive::IntoStatic
86)]
87#[serde(tag = "$type")]
88#[serde(bound(deserialize = "'de: 'a"))]
89pub enum DraftRecordLabels<'a> {
90    #[serde(rename = "com.atproto.label.defs#selfLabels")]
91    DefsSelfLabels(Box<crate::com_atproto::label::SelfLabels<'a>>),
92}
93
94impl jacquard_common::types::collection::Collection for Draft<'_> {
95    const NSID: &'static str = "net.anisota.feed.draft";
96}
97
98#[jacquard_derive::lexicon]
99#[derive(
100    serde::Serialize,
101    serde::Deserialize,
102    Debug,
103    Clone,
104    PartialEq,
105    Eq,
106    jacquard_derive::IntoStatic
107)]
108#[serde(rename_all = "camelCase")]
109pub struct ReplyRef<'a> {
110    #[serde(borrow)]
111    pub parent: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
112    #[serde(borrow)]
113    pub root: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
114}