rs-plugin-common-interfaces 0.46.0

Common description for plugin creation
Documentation
use serde::{Deserialize, Serialize};

use crate::ElementType;

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
#[serde(rename_all = "camelCase")]
pub struct RsDeleted {
    pub id: String,
    /// When it was deleted, in milliseconds since the Unix epoch.
    pub date: i64,
    #[serde(rename = "type")]
    pub kind: ElementType,
}

impl RsDeleted {
    pub fn new(kind: ElementType, id: String, date: i64) -> Self {
        Self { id, date, kind }
    }
}

/// Filter of the deleted list (`GET /libraries/:id/deleted`).
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct DeletedQuery {
    /// Only deletions strictly after this time, in unix milliseconds.
    pub after: Option<i64>,
    #[serde(rename = "type")]
    pub kind: Option<ElementType>,

    #[serde(default)]
    pub order: crate::domain::media::SqlOrder,
    pub limit: Option<u32>,
    pub offset: Option<u32>,
}