/*
 * 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 ReqPostSubscription {
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "owner", skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    #[serde(rename = "typeFilter")]
    pub type_filter: String,
    #[serde(rename = "subjectFilter")]
    pub subject_filter: String,
    #[serde(rename = "deliveryTargets")]
    pub delivery_targets: Vec<models::DeliveryTarget>,
    #[serde(rename = "ttlMinutes", skip_serializing_if = "Option::is_none")]
    pub ttl_minutes: Option<i32>,
}

impl ReqPostSubscription {
    pub fn new(
        type_filter: String,
        subject_filter: String,
        delivery_targets: Vec<models::DeliveryTarget>,
    ) -> ReqPostSubscription {
        ReqPostSubscription {
            name: None,
            description: None,
            owner: None,
            enabled: None,
            type_filter,
            subject_filter,
            delivery_targets,
            ttl_minutes: None,
        }
    }
}
