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};

/// PreferenceRecord : A subscriber preference for a specific workflow or channel.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PreferenceRecord {
    #[serde(rename = "channels")]
    pub channels: models::PreferenceChannels,
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// Subscriber identifier.
    #[serde(rename = "subscriber_id")]
    pub subscriber_id: String,
    #[serde(rename = "workflow_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub workflow_id: Option<Option<uuid::Uuid>>,
}

impl PreferenceRecord {
    /// A subscriber preference for a specific workflow or channel.
    pub fn new(channels: models::PreferenceChannels, enabled: bool, subscriber_id: String) -> PreferenceRecord {
        PreferenceRecord {
            channels,
            enabled,
            subscriber_id,
            workflow_id: None,
        }
    }
}