proto-blue-api 0.2.1

AT Protocol high-level API: agent, rich text, moderation, generated types
Documentation
// Generated by atproto-codegen. Do not edit.
//! Lexicon: app.bsky.draft.defs

use serde::{Deserialize, Serialize};

/// A draft containing an array of draft posts.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Draft {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub device_id: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub device_name: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub langs: Option<Vec<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub postgate_embedding_rules: Option<Vec<serde_json::Value>>,
    pub posts: Vec<DraftPost>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub threadgate_allow: Option<Vec<serde_json::Value>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedCaption {
    pub content: String,
    pub lang: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedExternal {
    pub uri: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedImage {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub alt: Option<String>,
    pub local_ref: DraftEmbedLocalRef,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedLocalRef {
    pub path: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedRecord {
    pub record: crate::com::atproto::repo::strongRef::Main,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftEmbedVideo {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub alt: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub captions: Option<Vec<DraftEmbedCaption>>,
    pub local_ref: DraftEmbedLocalRef,
}

/// One of the posts that compose a draft.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftPost {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed_externals: Option<Vec<DraftEmbedExternal>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed_images: Option<Vec<DraftEmbedImage>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed_records: Option<Vec<DraftEmbedRecord>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed_videos: Option<Vec<DraftEmbedVideo>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<serde_json::Value>,
    pub text: String,
}

/// View to present drafts data to users.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftView {
    pub created_at: String,
    pub draft: Draft,
    pub id: String,
    pub updated_at: String,
}

/// A draft with an identifier, used to store drafts in private storage (stash).
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DraftWithId {
    pub draft: Draft,
    pub id: String,
}