Skip to main content

atrium_api/app/bsky/draft/
create_draft.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.draft.createDraft` namespace.
3pub const NSID: &str = "app.bsky.draft.createDraft";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    pub draft: crate::app::bsky::draft::defs::Draft,
8}
9pub type Input = crate::types::Object<InputData>;
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
11#[serde(rename_all = "camelCase")]
12pub struct OutputData {
13    ///The ID of the created draft.
14    pub id: crate::types::string::Tid,
15}
16pub type Output = crate::types::Object<OutputData>;
17#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
18#[serde(tag = "error", content = "message")]
19pub enum Error {
20    ///Trying to insert a new draft when the limit was already reached.
21    DraftLimitReached(Option<String>),
22}
23impl std::fmt::Display for Error {
24    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
25        match self {
26            Error::DraftLimitReached(msg) => {
27                write!(_f, "DraftLimitReached")?;
28                if let Some(msg) = msg {
29                    write!(_f, ": {msg}")?;
30                }
31            }
32        }
33        Ok(())
34    }
35}