use serde::Deserialize;
use synd_feed::{
entry::EntryId,
types::{Category, FeedUrl, Requirement, Time},
};
use super::PageInfo;
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TimelineEntry {
pub order_time: Time,
pub entry: Entry,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TimelineEntryConnection {
pub nodes: Vec<TimelineEntry>,
pub page_info: PageInfo,
pub seq: i64,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TimelineChangesPayload {
pub changes: Vec<TimelineChange>,
pub seq: i64,
pub has_more: bool,
}
#[derive(Debug, Clone, Deserialize)]
#[serde(tag = "__typename")]
pub enum TimelineChange {
#[serde(rename = "TimelineChangeUpsert", rename_all = "camelCase")]
Upsert { timeline_entry: Box<TimelineEntry> },
#[serde(rename = "TimelineChangeRemove", rename_all = "camelCase")]
Remove { entry_id: EntryId },
}
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Entry {
pub id: EntryId,
pub title: Option<String>,
pub published: Option<Time>,
pub updated: Option<Time>,
pub website_url: Option<String>,
pub summary: Option<String>,
pub feed: FeedMeta,
}
#[derive(Debug, Clone, Deserialize)]
pub struct FeedMeta {
pub title: Option<String>,
pub url: FeedUrl,
#[serde(default, with = "super::requirement")]
pub requirement: Option<Requirement>,
pub category: Option<Category<'static>>,
}