/*
* SpatioAPI
*
* 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.
*
* The version of the OpenAPI document: v1
* Contact: hello@spatio.app
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// BlockContent : Type-specific payload for a block. Fields populated depend on `Block.type`. All fields are optional at the schema level; the runtime enforces the per-type contract. Note: this object uses snake_case keys to match the JSON the Go `providers.BlockContent` struct emits and accepts. Other parts of the SpatioAPI use camelCase; blocks are the exception because the block model is shared with external Notion-like providers whose canonical wire format is snake_case.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BlockContent {
#[serde(rename = "rich_text", skip_serializing_if = "Option::is_none")]
pub rich_text: Option<Vec<models::RichTextObject>>,
/// Programming language for `code` blocks.
#[serde(rename = "language", skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
/// Toggle state for `to_do` blocks.
#[serde(rename = "checked", skip_serializing_if = "Option::is_none")]
pub checked: Option<bool>,
/// Emoji or short string for `callout` blocks.
#[serde(rename = "icon", skip_serializing_if = "Option::is_none")]
pub icon: Option<String>,
/// Theme color for `callout` blocks.
#[serde(rename = "color", skip_serializing_if = "Option::is_none")]
pub color: Option<String>,
/// Source URL for `image`, `video`, `file` blocks.
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// Visible caption for media blocks.
#[serde(rename = "caption", skip_serializing_if = "Option::is_none")]
pub caption: Option<String>,
/// Screen-reader description for media blocks. Distinct from `caption` (visible to readers) — required for accessible notes when the image conveys meaning.
#[serde(rename = "alt_text", skip_serializing_if = "Option::is_none")]
pub alt_text: Option<String>,
/// Source URL for `embed` blocks.
#[serde(rename = "embed_url", skip_serializing_if = "Option::is_none")]
pub embed_url: Option<String>,
/// 2D rich-text grid for `table` and `table_row` blocks.
#[serde(rename = "cells", skip_serializing_if = "Option::is_none")]
pub cells: Option<Vec<Vec<models::RichTextObject>>>,
/// TeX/MathJax expression for `equation` blocks.
#[serde(rename = "expression", skip_serializing_if = "Option::is_none")]
pub expression: Option<String>,
}
impl BlockContent {
/// Type-specific payload for a block. Fields populated depend on `Block.type`. All fields are optional at the schema level; the runtime enforces the per-type contract. Note: this object uses snake_case keys to match the JSON the Go `providers.BlockContent` struct emits and accepts. Other parts of the SpatioAPI use camelCase; blocks are the exception because the block model is shared with external Notion-like providers whose canonical wire format is snake_case.
pub fn new() -> BlockContent {
BlockContent {
rich_text: None,
language: None,
checked: None,
icon: None,
color: None,
url: None,
caption: None,
alt_text: None,
embed_url: None,
cells: None,
expression: None,
}
}
}