#[cfg(feature = "catchall")]
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
#[cfg(feature = "catchall")]
use serde_json::Value;
use super::{SongCoreStats, SongCoreWithRDC};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
pub struct SearchResponse {
pub hits: Vec<Hit>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
#[serde(rename_all = "lowercase")]
pub enum Hit {
Song(HitCore<SongCoreWithRDC<SongCoreStats>>),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
pub struct HitCore<R> {
pub highlights: Vec<()>,
pub index: HitIndex,
pub result: R,
#[cfg(feature = "catchall")]
#[serde(flatten)]
pub extra: HashMap<String, Value>,
}
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default)]
#[serde(rename_all = "lowercase")]
pub enum HitIndex {
#[default]
Song,
}