Skip to main content

rs_plugin_common_interfaces/domain/
deleted.rs

1use serde::{Deserialize, Serialize};
2
3use crate::ElementType;
4
5#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
6#[serde(rename_all = "camelCase")]
7pub struct RsDeleted {
8    pub id: String,
9    /// When it was deleted, in milliseconds since the Unix epoch.
10    pub date: i64,
11    #[serde(rename = "type")]
12    pub kind: ElementType,
13}
14
15impl RsDeleted {
16    pub fn new(kind: ElementType, id: String, date: i64) -> Self {
17        Self { id, date, kind }
18    }
19}
20
21/// Filter of the deleted list (`GET /libraries/:id/deleted`).
22#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq)]
23#[serde(rename_all = "camelCase")]
24pub struct DeletedQuery {
25    /// Only deletions strictly after this time, in unix milliseconds.
26    pub after: Option<i64>,
27    #[serde(rename = "type")]
28    pub kind: Option<ElementType>,
29
30    #[serde(default)]
31    pub order: crate::domain::media::SqlOrder,
32    pub limit: Option<u32>,
33    pub offset: Option<u32>,
34}