Skip to main content

atrium_api/app/bsky/draft/
defs.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.draft.defs` namespace.
3///A draft containing an array of draft posts.
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct DraftData {
7    ///UUIDv4 identifier of the device that created this draft.
8    #[serde(skip_serializing_if = "core::option::Option::is_none")]
9    pub device_id: core::option::Option<String>,
10    ///The device and/or platform on which the draft was created.
11    #[serde(skip_serializing_if = "core::option::Option::is_none")]
12    pub device_name: core::option::Option<String>,
13    ///Indicates human language of posts primary text content.
14    #[serde(skip_serializing_if = "core::option::Option::is_none")]
15    pub langs: core::option::Option<Vec<crate::types::string::Language>>,
16    ///Embedding rules for the postgates to be created when this draft is published.
17    #[serde(skip_serializing_if = "core::option::Option::is_none")]
18    pub postgate_embedding_rules: core::option::Option<
19        Vec<crate::types::Union<DraftPostgateEmbeddingRulesItem>>,
20    >,
21    ///Array of draft posts that compose this draft.
22    pub posts: Vec<DraftPost>,
23    ///Allow-rules for the threadgate to be created when this draft is published.
24    #[serde(skip_serializing_if = "core::option::Option::is_none")]
25    pub threadgate_allow: core::option::Option<
26        Vec<crate::types::Union<DraftThreadgateAllowItem>>,
27    >,
28}
29pub type Draft = crate::types::Object<DraftData>;
30#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
31#[serde(rename_all = "camelCase")]
32pub struct DraftEmbedCaptionData {
33    pub content: String,
34    pub lang: crate::types::string::Language,
35}
36pub type DraftEmbedCaption = crate::types::Object<DraftEmbedCaptionData>;
37#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
38#[serde(rename_all = "camelCase")]
39pub struct DraftEmbedExternalData {
40    pub uri: String,
41}
42pub type DraftEmbedExternal = crate::types::Object<DraftEmbedExternalData>;
43#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
44#[serde(rename_all = "camelCase")]
45pub struct DraftEmbedGalleryData {
46    pub items: DraftEmbedGalleryItems,
47}
48pub type DraftEmbedGallery = crate::types::Object<DraftEmbedGalleryData>;
49///The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.
50pub type DraftEmbedGalleryItems = Vec<crate::types::Union<DraftEmbedGalleryItemsItem>>;
51#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
52#[serde(rename_all = "camelCase")]
53pub struct DraftEmbedImageData {
54    #[serde(skip_serializing_if = "core::option::Option::is_none")]
55    pub alt: core::option::Option<String>,
56    pub local_ref: DraftEmbedLocalRef,
57}
58pub type DraftEmbedImage = crate::types::Object<DraftEmbedImageData>;
59#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
60#[serde(rename_all = "camelCase")]
61pub struct DraftEmbedLocalRefData {
62    ///Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts.
63    pub path: String,
64}
65pub type DraftEmbedLocalRef = crate::types::Object<DraftEmbedLocalRefData>;
66#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
67#[serde(rename_all = "camelCase")]
68pub struct DraftEmbedRecordData {
69    pub record: crate::com::atproto::repo::strong_ref::Main,
70}
71pub type DraftEmbedRecord = crate::types::Object<DraftEmbedRecordData>;
72#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
73#[serde(rename_all = "camelCase")]
74pub struct DraftEmbedVideoData {
75    #[serde(skip_serializing_if = "core::option::Option::is_none")]
76    pub alt: core::option::Option<String>,
77    #[serde(skip_serializing_if = "core::option::Option::is_none")]
78    pub captions: core::option::Option<Vec<DraftEmbedCaption>>,
79    pub local_ref: DraftEmbedLocalRef,
80}
81pub type DraftEmbedVideo = crate::types::Object<DraftEmbedVideoData>;
82///One of the posts that compose a draft.
83#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
84#[serde(rename_all = "camelCase")]
85pub struct DraftPostData {
86    #[serde(skip_serializing_if = "core::option::Option::is_none")]
87    pub embed_externals: core::option::Option<Vec<DraftEmbedExternal>>,
88    #[serde(skip_serializing_if = "core::option::Option::is_none")]
89    pub embed_gallery: core::option::Option<DraftEmbedGallery>,
90    #[serde(skip_serializing_if = "core::option::Option::is_none")]
91    pub embed_images: core::option::Option<Vec<DraftEmbedImage>>,
92    #[serde(skip_serializing_if = "core::option::Option::is_none")]
93    pub embed_records: core::option::Option<Vec<DraftEmbedRecord>>,
94    #[serde(skip_serializing_if = "core::option::Option::is_none")]
95    pub embed_videos: core::option::Option<Vec<DraftEmbedVideo>>,
96    ///Self-label values for this post. Effectively content warnings.
97    #[serde(skip_serializing_if = "core::option::Option::is_none")]
98    pub labels: core::option::Option<crate::types::Union<DraftPostLabelsRefs>>,
99    ///The primary post content. It has a higher limit than post contents to allow storing a larger text that can later be refined into smaller posts.
100    pub text: String,
101}
102pub type DraftPost = crate::types::Object<DraftPostData>;
103///View to present drafts data to users.
104#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
105#[serde(rename_all = "camelCase")]
106pub struct DraftViewData {
107    ///The time the draft was created.
108    pub created_at: crate::types::string::Datetime,
109    pub draft: Draft,
110    ///A TID to be used as a draft identifier.
111    pub id: crate::types::string::Tid,
112    ///The time the draft was last updated.
113    pub updated_at: crate::types::string::Datetime,
114}
115pub type DraftView = crate::types::Object<DraftViewData>;
116///A draft with an identifier, used to store drafts in private storage (stash).
117#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
118#[serde(rename_all = "camelCase")]
119pub struct DraftWithIdData {
120    pub draft: Draft,
121    ///A TID to be used as a draft identifier.
122    pub id: crate::types::string::Tid,
123}
124pub type DraftWithId = crate::types::Object<DraftWithIdData>;
125#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
126#[serde(tag = "$type")]
127pub enum DraftEmbedGalleryItemsItem {
128    #[serde(rename = "app.bsky.draft.defs#draftEmbedImage")]
129    DraftEmbedImage(Box<DraftEmbedImage>),
130}
131#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
132#[serde(tag = "$type")]
133pub enum DraftPostLabelsRefs {
134    #[serde(rename = "com.atproto.label.defs#selfLabels")]
135    ComAtprotoLabelDefsSelfLabels(Box<crate::com::atproto::label::defs::SelfLabels>),
136}
137#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
138#[serde(tag = "$type")]
139pub enum DraftPostgateEmbeddingRulesItem {
140    #[serde(rename = "app.bsky.feed.postgate#disableRule")]
141    AppBskyFeedPostgateDisableRule(Box<crate::app::bsky::feed::postgate::DisableRule>),
142}
143#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
144#[serde(tag = "$type")]
145pub enum DraftThreadgateAllowItem {
146    #[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
147    AppBskyFeedThreadgateMentionRule(
148        Box<crate::app::bsky::feed::threadgate::MentionRule>,
149    ),
150    #[serde(rename = "app.bsky.feed.threadgate#followerRule")]
151    AppBskyFeedThreadgateFollowerRule(
152        Box<crate::app::bsky::feed::threadgate::FollowerRule>,
153    ),
154    #[serde(rename = "app.bsky.feed.threadgate#followingRule")]
155    AppBskyFeedThreadgateFollowingRule(
156        Box<crate::app::bsky::feed::threadgate::FollowingRule>,
157    ),
158    #[serde(rename = "app.bsky.feed.threadgate#listRule")]
159    AppBskyFeedThreadgateListRule(Box<crate::app::bsky::feed::threadgate::ListRule>),
160}