use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum SentFile {
Id(String),
Url(String),
Upload(String),
}
impl SentFile {
pub fn is_upload(&self) -> bool {
matches!(self, SentFile::Upload(_))
}
}
pub(crate) fn skip_ser_sf_opt(f: &Option<SentFile>) -> bool {
matches!(f, Some(SentFile::Upload(_)))
}
pub(crate) struct SentFileInfo {
pub field: &'static str,
pub path: String,
}
pub(crate) trait FileHolder {
fn files(&self) -> Vec<SentFileInfo>;
}
impl FileHolder for () {
fn files(&self) -> Vec<SentFileInfo> {
vec![]
}
}