/*
 * Tapis Notifications API
 *
 * The Tapis Notifications API provides for management of subscriptions and event publication
 *
 * The version of the OpenAPI document: 25Q4.0
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Event {
    #[serde(rename = "source")]
    pub source: String,
    #[serde(rename = "type")]
    pub r#type: String,
    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
    pub data: Option<String>,
    #[serde(rename = "seriesId", skip_serializing_if = "Option::is_none")]
    pub series_id: Option<String>,
    #[serde(rename = "endSeries", skip_serializing_if = "Option::is_none")]
    pub end_series: Option<bool>,
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    #[serde(
        rename = "deleteSubscriptionsMatchingSubject",
        skip_serializing_if = "Option::is_none"
    )]
    pub delete_subscriptions_matching_subject: Option<bool>,
    #[serde(rename = "tenant", skip_serializing_if = "Option::is_none")]
    pub tenant: Option<String>,
    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
    #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
    pub uuid: Option<String>,
    #[serde(rename = "received", skip_serializing_if = "Option::is_none")]
    pub received: Option<String>,
    #[serde(rename = "seriesSeqCount", skip_serializing_if = "Option::is_none")]
    pub series_seq_count: Option<i32>,
}

impl Event {
    pub fn new(source: String, r#type: String, timestamp: String) -> Event {
        Event {
            source,
            r#type,
            subject: None,
            data: None,
            series_id: None,
            end_series: None,
            timestamp,
            delete_subscriptions_matching_subject: None,
            tenant: None,
            user: None,
            uuid: None,
            received: None,
            series_seq_count: None,
        }
    }
}
