atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.draft.defs` namespace.
///A draft containing an array of draft posts.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftData {
    ///UUIDv4 identifier of the device that created this draft.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub device_id: core::option::Option<String>,
    ///The device and/or platform on which the draft was created.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub device_name: core::option::Option<String>,
    ///Indicates human language of posts primary text content.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub langs: core::option::Option<Vec<crate::types::string::Language>>,
    ///Embedding rules for the postgates to be created when this draft is published.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub postgate_embedding_rules: core::option::Option<
        Vec<crate::types::Union<DraftPostgateEmbeddingRulesItem>>,
    >,
    ///Array of draft posts that compose this draft.
    pub posts: Vec<DraftPost>,
    ///Allow-rules for the threadgate to be created when this draft is published.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub threadgate_allow: core::option::Option<
        Vec<crate::types::Union<DraftThreadgateAllowItem>>,
    >,
}
pub type Draft = crate::types::Object<DraftData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedCaptionData {
    pub content: String,
    pub lang: crate::types::string::Language,
}
pub type DraftEmbedCaption = crate::types::Object<DraftEmbedCaptionData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedExternalData {
    pub uri: String,
}
pub type DraftEmbedExternal = crate::types::Object<DraftEmbedExternalData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedGalleryData {
    pub items: DraftEmbedGalleryItems,
}
pub type DraftEmbedGallery = crate::types::Object<DraftEmbedGalleryData>;
///The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.
pub type DraftEmbedGalleryItems = Vec<crate::types::Union<DraftEmbedGalleryItemsItem>>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedImageData {
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub alt: core::option::Option<String>,
    pub local_ref: DraftEmbedLocalRef,
}
pub type DraftEmbedImage = crate::types::Object<DraftEmbedImageData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedLocalRefData {
    ///Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts.
    pub path: String,
}
pub type DraftEmbedLocalRef = crate::types::Object<DraftEmbedLocalRefData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedRecordData {
    pub record: crate::com::atproto::repo::strong_ref::Main,
}
pub type DraftEmbedRecord = crate::types::Object<DraftEmbedRecordData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedVideoData {
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub alt: core::option::Option<String>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub captions: core::option::Option<Vec<DraftEmbedCaption>>,
    pub local_ref: DraftEmbedLocalRef,
}
pub type DraftEmbedVideo = crate::types::Object<DraftEmbedVideoData>;
///One of the posts that compose a draft.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftPostData {
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed_externals: core::option::Option<Vec<DraftEmbedExternal>>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed_gallery: core::option::Option<DraftEmbedGallery>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed_images: core::option::Option<Vec<DraftEmbedImage>>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed_records: core::option::Option<Vec<DraftEmbedRecord>>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed_videos: core::option::Option<Vec<DraftEmbedVideo>>,
    ///Self-label values for this post. Effectively content warnings.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub labels: core::option::Option<crate::types::Union<DraftPostLabelsRefs>>,
    ///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.
    pub text: String,
}
pub type DraftPost = crate::types::Object<DraftPostData>;
///View to present drafts data to users.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftViewData {
    ///The time the draft was created.
    pub created_at: crate::types::string::Datetime,
    pub draft: Draft,
    ///A TID to be used as a draft identifier.
    pub id: crate::types::string::Tid,
    ///The time the draft was last updated.
    pub updated_at: crate::types::string::Datetime,
}
pub type DraftView = crate::types::Object<DraftViewData>;
///A draft with an identifier, used to store drafts in private storage (stash).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DraftWithIdData {
    pub draft: Draft,
    ///A TID to be used as a draft identifier.
    pub id: crate::types::string::Tid,
}
pub type DraftWithId = crate::types::Object<DraftWithIdData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum DraftEmbedGalleryItemsItem {
    #[serde(rename = "app.bsky.draft.defs#draftEmbedImage")]
    DraftEmbedImage(Box<DraftEmbedImage>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum DraftPostLabelsRefs {
    #[serde(rename = "com.atproto.label.defs#selfLabels")]
    ComAtprotoLabelDefsSelfLabels(Box<crate::com::atproto::label::defs::SelfLabels>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum DraftPostgateEmbeddingRulesItem {
    #[serde(rename = "app.bsky.feed.postgate#disableRule")]
    AppBskyFeedPostgateDisableRule(Box<crate::app::bsky::feed::postgate::DisableRule>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum DraftThreadgateAllowItem {
    #[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
    AppBskyFeedThreadgateMentionRule(
        Box<crate::app::bsky::feed::threadgate::MentionRule>,
    ),
    #[serde(rename = "app.bsky.feed.threadgate#followerRule")]
    AppBskyFeedThreadgateFollowerRule(
        Box<crate::app::bsky::feed::threadgate::FollowerRule>,
    ),
    #[serde(rename = "app.bsky.feed.threadgate#followingRule")]
    AppBskyFeedThreadgateFollowingRule(
        Box<crate::app::bsky::feed::threadgate::FollowingRule>,
    ),
    #[serde(rename = "app.bsky.feed.threadgate#listRule")]
    AppBskyFeedThreadgateListRule(Box<crate::app::bsky::feed::threadgate::ListRule>),
}