Skip to main content

torbox_core_rs/data/
mod.rs

1pub mod creation;
2pub mod general;
3pub mod limits;
4pub mod notifications;
5pub mod torrent;
6pub mod user;
7pub mod webdownload;
8
9use crate::data::{
10    limits::{ActiveLimitStatus, CooldownLimitStatus, MonthlyLimitStatus},
11    torrent::TorrentCreationResponse,
12    torrent::{TorrentData, TorrentMap, TorrentMeta, TorrentStatus},
13    user::{Job, UserProfile},
14    webdownload::{HosterInfo, WebdownloadCreationResponse, WebdownloadStatus},
15};
16use serde::{Deserialize, Serialize};
17
18#[derive(Debug, Serialize, Deserialize)]
19#[cfg_attr(feature = "specta", derive(specta::Type))]
20#[serde(untagged)]
21pub enum ApiDataResponse {
22    Message(String),
23    TorrentCache(Box<TorrentData>),
24    TorrentStatusList(Box<Vec<TorrentStatus>>),
25    TorrentMeta(Box<TorrentMeta>),
26    TorrentMap(TorrentMap),
27    UserData(Box<UserProfile>),
28    Jobs(Box<Vec<Job>>),
29    TorrentCreation(TorrentCreationResponse),
30    ActiveLimit(ActiveLimitStatus),
31    MonthlyLimit(MonthlyLimitStatus),
32    CooldownLimit(CooldownLimitStatus),
33    WebdownloadCreation(WebdownloadCreationResponse),
34    WebdownloadList(Box<Vec<WebdownloadStatus>>),
35    HosterInfoList(Box<Vec<HosterInfo>>),
36}