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
4use serde::{Deserialize, Serialize};
5
6/// A draft containing an array of draft posts.
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct Draft {
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub device_id: Option<String>,
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub device_name: Option<String>,
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub langs: Option<Vec<String>>,
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub postgate_embedding_rules: Option<Vec<serde_json::Value>>,
18    pub posts: Vec<DraftPost>,
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub threadgate_allow: Option<Vec<serde_json::Value>>,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24#[serde(rename_all = "camelCase")]
25pub struct DraftEmbedCaption {
26    pub content: String,
27    pub lang: String,
28}
29
30#[derive(Debug, Clone, Serialize, Deserialize)]
31#[serde(rename_all = "camelCase")]
32pub struct DraftEmbedExternal {
33    pub uri: String,
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(rename_all = "camelCase")]
38pub struct DraftEmbedImage {
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub alt: Option<String>,
41    pub local_ref: DraftEmbedLocalRef,
42}
43
44#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(rename_all = "camelCase")]
46pub struct DraftEmbedLocalRef {
47    pub path: String,
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize)]
51#[serde(rename_all = "camelCase")]
52pub struct DraftEmbedRecord {
53    pub record: crate::com::atproto::repo::strong_ref::Main,
54}
55
56#[derive(Debug, Clone, Serialize, Deserialize)]
57#[serde(rename_all = "camelCase")]
58pub struct DraftEmbedVideo {
59    #[serde(skip_serializing_if = "Option::is_none")]
60    pub alt: Option<String>,
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub captions: Option<Vec<DraftEmbedCaption>>,
63    pub local_ref: DraftEmbedLocalRef,
64}
65
66/// One of the posts that compose a draft.
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(rename_all = "camelCase")]
69pub struct DraftPost {
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub embed_externals: Option<Vec<DraftEmbedExternal>>,
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub embed_images: Option<Vec<DraftEmbedImage>>,
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub embed_records: Option<Vec<DraftEmbedRecord>>,
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub embed_videos: Option<Vec<DraftEmbedVideo>>,
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub labels: Option<serde_json::Value>,
80    pub text: String,
81}
82
83/// View to present drafts data to users.
84#[derive(Debug, Clone, Serialize, Deserialize)]
85#[serde(rename_all = "camelCase")]
86pub struct DraftView {
87    pub created_at: String,
88    pub draft: Draft,
89    pub id: String,
90    pub updated_at: String,
91}
92
93/// A draft with an identifier, used to store drafts in private storage (stash).
94#[derive(Debug, Clone, Serialize, Deserialize)]
95#[serde(rename_all = "camelCase")]
96pub struct DraftWithId {
97    pub draft: Draft,
98    pub id: String,
99}