Skip to main content

proto_blue_api/generated/app/bsky/draft/
defs.rs

1// Generated by atproto-codegen. Do not edit.
2//! Lexicon: app.bsky.draft.defs
3#![allow(clippy::pedantic, clippy::nursery, clippy::all)]
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(tag = "$type")]
9pub enum DraftPostgateEmbeddingRulesItemRefs {
10    #[serde(rename = "app.bsky.feed.postgate#disableRule")]
11    BskyFeedPostgateDisableRule(Box<crate::app::bsky::feed::postgate::DisableRule>),
12    #[serde(other)]
13    Other,
14}
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17#[serde(tag = "$type")]
18pub enum DraftThreadgateAllowItemRefs {
19    #[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
20    BskyFeedThreadgateMentionRule(Box<crate::app::bsky::feed::threadgate::MentionRule>),
21    #[serde(rename = "app.bsky.feed.threadgate#followerRule")]
22    BskyFeedThreadgateFollowerRule(Box<crate::app::bsky::feed::threadgate::FollowerRule>),
23    #[serde(rename = "app.bsky.feed.threadgate#followingRule")]
24    BskyFeedThreadgateFollowingRule(Box<crate::app::bsky::feed::threadgate::FollowingRule>),
25    #[serde(rename = "app.bsky.feed.threadgate#listRule")]
26    BskyFeedThreadgateListRule(Box<crate::app::bsky::feed::threadgate::ListRule>),
27    #[serde(other)]
28    Other,
29}
30
31/// A draft containing an array of draft posts.
32#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(rename_all = "camelCase")]
34pub struct Draft {
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub device_id: Option<String>,
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub device_name: Option<String>,
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub langs: Option<Vec<String>>,
41    #[serde(skip_serializing_if = "Option::is_none")]
42    pub postgate_embedding_rules: Option<Vec<DraftPostgateEmbeddingRulesItemRefs>>,
43    pub posts: Vec<DraftPost>,
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub threadgate_allow: Option<Vec<DraftThreadgateAllowItemRefs>>,
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
49#[serde(rename_all = "camelCase")]
50pub struct DraftEmbedCaption {
51    pub content: String,
52    pub lang: String,
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize)]
56#[serde(rename_all = "camelCase")]
57pub struct DraftEmbedExternal {
58    pub uri: String,
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub struct DraftEmbedImage {
64    #[serde(skip_serializing_if = "Option::is_none")]
65    pub alt: Option<String>,
66    pub local_ref: DraftEmbedLocalRef,
67}
68
69#[derive(Debug, Clone, Serialize, Deserialize)]
70#[serde(rename_all = "camelCase")]
71pub struct DraftEmbedLocalRef {
72    pub path: String,
73}
74
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(rename_all = "camelCase")]
77pub struct DraftEmbedRecord {
78    pub record: crate::com::atproto::repo::strong_ref::Main,
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
82#[serde(rename_all = "camelCase")]
83pub struct DraftEmbedVideo {
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub alt: Option<String>,
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub captions: Option<Vec<DraftEmbedCaption>>,
88    pub local_ref: DraftEmbedLocalRef,
89}
90
91/// Self-label values for this post. Effectively content warnings.
92#[derive(Debug, Clone, Serialize, Deserialize)]
93#[serde(tag = "$type")]
94pub enum DraftPostLabelsRefs {
95    #[serde(rename = "com.atproto.label.defs#selfLabels")]
96    AtprotoLabelDefsSelfLabels(Box<crate::com::atproto::label::defs::SelfLabels>),
97    #[serde(other)]
98    Other,
99}
100
101/// One of the posts that compose a draft.
102#[derive(Debug, Clone, Serialize, Deserialize)]
103#[serde(rename_all = "camelCase")]
104pub struct DraftPost {
105    #[serde(skip_serializing_if = "Option::is_none")]
106    pub embed_externals: Option<Vec<DraftEmbedExternal>>,
107    #[serde(skip_serializing_if = "Option::is_none")]
108    pub embed_images: Option<Vec<DraftEmbedImage>>,
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub embed_records: Option<Vec<DraftEmbedRecord>>,
111    #[serde(skip_serializing_if = "Option::is_none")]
112    pub embed_videos: Option<Vec<DraftEmbedVideo>>,
113    #[serde(skip_serializing_if = "Option::is_none")]
114    pub labels: Option<DraftPostLabelsRefs>,
115    pub text: String,
116}
117
118/// View to present drafts data to users.
119#[derive(Debug, Clone, Serialize, Deserialize)]
120#[serde(rename_all = "camelCase")]
121pub struct DraftView {
122    pub created_at: proto_blue_syntax::Datetime,
123    pub draft: Draft,
124    pub id: proto_blue_syntax::Tid,
125    pub updated_at: proto_blue_syntax::Datetime,
126}
127
128/// A draft with an identifier, used to store drafts in private storage (stash).
129#[derive(Debug, Clone, Serialize, Deserialize)]
130#[serde(rename_all = "camelCase")]
131pub struct DraftWithId {
132    pub draft: Draft,
133    pub id: proto_blue_syntax::Tid,
134}