notion_api_rs/notion/
common.rs

1use serde::{Deserialize, Serialize};
2
3/// https://developers.notion.com/reference/file-object
4#[derive(Debug, Serialize, Deserialize)]
5pub struct File {
6    pub url: String,
7    pub expiry_time: Option<String>
8}
9
10#[derive(Debug, Serialize, Deserialize)]
11pub struct RichText {
12    pub rich_text_type: String,
13    pub href: Option<String>,
14    pub plain_text: String,
15    pub annotations: Annotations,
16    pub text: Option<Text>
17}
18
19#[derive(Debug, Serialize, Deserialize)]
20pub struct Annotations {
21    pub bold: bool,
22    pub italic: bool,
23    pub strikethrough: bool,
24    pub underline: bool,
25    pub code: bool,
26    pub color: String
27}
28
29#[derive(Debug, Serialize, Deserialize)]
30pub struct Text {
31    pub content: String,
32    pub link: Option<Link>
33}
34
35#[derive(Debug, Serialize, Deserialize)]
36pub struct Link {
37    pub link_type: String,
38    pub url: String,
39}