Skip to main content

spatio_sdk/models/
block_type.rs

1/*
2 * SpatioAPI
3 *
4 * The REST API that owns every resource in your Spatio workspace: notes, sheets, slides, tasks, calendar events, mail, chat, files, and contacts. SpatioMCP wraps this API; Spatio Desktop reads from it. You can call it directly from your own code.  All requests must be authenticated with a Personal Access Token (`Authorization: Bearer pat_...`) or an OAuth 2.1 access token, and use HTTPS.  Official SDKs (MIT, generated from this spec on every release):  - TypeScript: https://github.com/spatio-labs/spatio-ts (`npm install @spatio-labs/spatio-ts`) - Python: https://github.com/spatio-labs/spatio-py (`pip install spatio-sdk`) - Go: https://github.com/spatio-labs/spatio-go (`go get github.com/spatio-labs/spatio-go`)  This specification is generated from the platform-service Go source on every push to `main`. The spec, not hand-written documentation, is the source of truth: server stubs and SDKs are generated from it, and any drift between the spec and the running service fails CI. 
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: hello@spatio.app
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BlockType : Discriminator for block types. The structure of `content` varies by type (e.g. `paragraph` carries `richText`; `code` carries `richText` + `language`; `image` carries `url` + `caption` + `altText`). 
15/// Discriminator for block types. The structure of `content` varies by type (e.g. `paragraph` carries `richText`; `code` carries `richText` + `language`; `image` carries `url` + `caption` + `altText`). 
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum BlockType {
18    #[serde(rename = "paragraph")]
19    Paragraph,
20    #[serde(rename = "heading_1")]
21    Heading1,
22    #[serde(rename = "heading_2")]
23    Heading2,
24    #[serde(rename = "heading_3")]
25    Heading3,
26    #[serde(rename = "bulleted_list_item")]
27    BulletedListItem,
28    #[serde(rename = "numbered_list_item")]
29    NumberedListItem,
30    #[serde(rename = "to_do")]
31    ToDo,
32    #[serde(rename = "toggle")]
33    Toggle,
34    #[serde(rename = "code")]
35    Code,
36    #[serde(rename = "quote")]
37    Quote,
38    #[serde(rename = "callout")]
39    Callout,
40    #[serde(rename = "divider")]
41    Divider,
42    #[serde(rename = "image")]
43    Image,
44    #[serde(rename = "video")]
45    Video,
46    #[serde(rename = "file")]
47    File,
48    #[serde(rename = "embed")]
49    Embed,
50    #[serde(rename = "table")]
51    Table,
52    #[serde(rename = "table_row")]
53    TableRow,
54    #[serde(rename = "column_list")]
55    ColumnList,
56    #[serde(rename = "column")]
57    Column,
58    #[serde(rename = "equation")]
59    Equation,
60    #[serde(rename = "breadcrumb")]
61    Breadcrumb,
62    #[serde(rename = "table_of_contents")]
63    TableOfContents,
64
65}
66
67impl std::fmt::Display for BlockType {
68    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
69        match self {
70            Self::Paragraph => write!(f, "paragraph"),
71            Self::Heading1 => write!(f, "heading_1"),
72            Self::Heading2 => write!(f, "heading_2"),
73            Self::Heading3 => write!(f, "heading_3"),
74            Self::BulletedListItem => write!(f, "bulleted_list_item"),
75            Self::NumberedListItem => write!(f, "numbered_list_item"),
76            Self::ToDo => write!(f, "to_do"),
77            Self::Toggle => write!(f, "toggle"),
78            Self::Code => write!(f, "code"),
79            Self::Quote => write!(f, "quote"),
80            Self::Callout => write!(f, "callout"),
81            Self::Divider => write!(f, "divider"),
82            Self::Image => write!(f, "image"),
83            Self::Video => write!(f, "video"),
84            Self::File => write!(f, "file"),
85            Self::Embed => write!(f, "embed"),
86            Self::Table => write!(f, "table"),
87            Self::TableRow => write!(f, "table_row"),
88            Self::ColumnList => write!(f, "column_list"),
89            Self::Column => write!(f, "column"),
90            Self::Equation => write!(f, "equation"),
91            Self::Breadcrumb => write!(f, "breadcrumb"),
92            Self::TableOfContents => write!(f, "table_of_contents"),
93        }
94    }
95}
96
97impl Default for BlockType {
98    fn default() -> BlockType {
99        Self::Paragraph
100    }
101}
102