enbbox 1.0.1

Notification infrastructure API — open-source alternative to Novu/Courier
Documentation
/*
 * enbbox API
 *
 * Notification infrastructure API — open-source alternative to Novu/Courier
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// InboxNotification : A notification item in a subscriber inbox feed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InboxNotification {
    #[serde(rename = "body")]
    pub body: String,
    #[serde(rename = "channel_type")]
    pub channel_type: String,
    /// ISO 8601 creation timestamp.
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "data")]
    pub data: serde_json::Value,
    /// Unique identifier.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "is_archived")]
    pub is_archived: bool,
    #[serde(rename = "is_read")]
    pub is_read: bool,
    #[serde(rename = "is_seen")]
    pub is_seen: bool,
    #[serde(rename = "read_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub read_at: Option<Option<String>>,
    #[serde(rename = "seen_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub seen_at: Option<Option<String>>,
    #[serde(rename = "subject", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub subject: Option<Option<String>>,
}

impl InboxNotification {
    /// A notification item in a subscriber inbox feed.
    pub fn new(body: String, channel_type: String, created_at: String, data: serde_json::Value, id: String, is_archived: bool, is_read: bool, is_seen: bool) -> InboxNotification {
        InboxNotification {
            body,
            channel_type,
            created_at,
            data,
            id,
            is_archived,
            is_read,
            is_seen,
            read_at: None,
            seen_at: None,
            subject: None,
        }
    }
}