/*
 * Websocket Subscription Schemas
 *
 * Schema definitions Websocket API subscriptions for Thalex exchange.
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotificationsNotificationsInner {
    /// Unique notification ID.
    #[serde(rename = "id")]
    pub id: String,
    /// Time of notification (Unix timestamp).
    #[serde(rename = "time")]
    pub time: rust_decimal::Decimal,
    /// Notification category (see API description / Notifications).
    #[serde(rename = "category")]
    pub category: String,
    /// Human-readable title for the notification.
    #[serde(rename = "title")]
    pub title: String,
    /// Human-readable message for the notification.
    #[serde(rename = "message")]
    pub message: String,
    /// Specifies what style to use for notification display.
    #[serde(rename = "display_type")]
    pub display_type: DisplayType,
    /// set to true if notification was marked as read.
    #[serde(rename = "read")]
    pub read: bool,
    /// Optional account name, only present if the notification is related to an account.
    #[serde(rename = "account_name", skip_serializing_if = "Option::is_none")]
    pub account_name: Option<String>,
    /// Optional account number only present if the notification is related to an account.
    #[serde(rename = "account_number", skip_serializing_if = "Option::is_none")]
    pub account_number: Option<String>,
    /// User preference - show popup for this notification
    #[serde(rename = "popup")]
    pub popup: bool,
}

impl NotificationsNotificationsInner {
    pub fn new(
        id: String,
        time: rust_decimal::Decimal,
        category: String,
        title: String,
        message: String,
        display_type: DisplayType,
        read: bool,
        popup: bool,
    ) -> NotificationsNotificationsInner {
        NotificationsNotificationsInner {
            id,
            time,
            category,
            title,
            message,
            display_type,
            read,
            account_name: None,
            account_number: None,
            popup,
        }
    }
}
/// Specifies what style to use for notification display.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DisplayType {
    #[serde(rename = "success")]
    Success,
    #[serde(rename = "failure")]
    Failure,
    #[serde(rename = "info")]
    Info,
    #[serde(rename = "warning")]
    Warning,
    #[serde(rename = "critical")]
    Critical,
}

impl Default for DisplayType {
    fn default() -> DisplayType {
        Self::Success
    }
}
