use relative_path::RelativePathBuf; use serde::Deserialize; /// Generic Model for paginated API. #[derive(Debug, serde::Deserialize)] pub struct Paginated { pub next: Option, pub results: Vec, } /// Model for the EPUB API. #[derive(Debug, Deserialize)] pub struct EpubResponse { pub publication_date: String, pub title: String, pub chapters: String, // This is a URL to the chapters list pub files: String, // This is a URL to the resource files pub spine: String, // This is a URL to the spine list pub table_of_contents: String, // This is a URL to the table of contents } /// Model for chapters API. #[derive(Debug, Deserialize)] pub struct Chapter { pub ourn: String, pub is_skippable: bool, } /// Model for files API. #[derive(Debug, Deserialize)] pub struct FileEntry { pub ourn: String, pub url: String, pub full_path: RelativePathBuf, pub media_type: String, pub filename: String, pub filename_ext: String, pub kind: String, } /// Model for spine API. #[derive(Debug, Deserialize)] pub struct SpineItem { pub ourn: String, pub reference_id: String, pub title: String, } /// Model for table of contents API. #[derive(Debug, Deserialize)] pub struct TocNode { pub depth: u32, pub reference_id: String, pub ourn: String, pub fragment: String, pub title: String, pub children: Vec, }