diff options
Diffstat (limited to 'src/models.rs')
| -rw-r--r-- | src/models.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs index 77afeb2..174b983 100644 --- a/src/models.rs +++ b/src/models.rs @@ -23,3 +23,30 @@ pub struct EpubResponse { pub chapters: String, // This is a URL to the chapters list pub files: String, // This is a URL to the resource files } + +// --- Generic Model for paginated API --- + +#[derive(Debug, serde::Deserialize)] +pub struct Paginated<T> { + pub next: Option<String>, + pub results: Vec<T>, +} + +/// 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: String, + pub media_type: String, + pub filename: String, + pub filename_ext: String, + pub kind: String, +} |
