/*
 * Streams API
 *
 * Manage Tapis Streams API.
 *
 * The version of the OpenAPI document: 1
 * 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 Channel {
    /// The name of channel.
    #[serde(rename = "channel_name", skip_serializing_if = "Option::is_none")]
    pub channel_name: Option<String>,
    /// The id generated by Tapis.
    #[serde(rename = "channel_id", skip_serializing_if = "Option::is_none")]
    pub channel_id: Option<String>,
    /// The time of channel creation
    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// The status of channel
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// The time of channel update
    #[serde(rename = "last_updated", skip_serializing_if = "Option::is_none")]
    pub last_updated: Option<String>,
    /// task id from Kapacitor
    #[serde(rename = "task_id", skip_serializing_if = "Option::is_none")]
    pub task_id: Option<String>,
    #[serde(
        rename = "triggers_with_actions",
        skip_serializing_if = "Option::is_none"
    )]
    pub triggers_with_actions: Option<Vec<models::ChannelTriggersWithActionsInner>>,
    /// Template id
    #[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
    pub template_id: Option<String>,
    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
    pub permissions: Option<Box<models::ChannelPermissions>>,
}

impl Channel {
    pub fn new() -> Channel {
        Channel {
            channel_name: None,
            channel_id: None,
            created_at: None,
            status: None,
            last_updated: None,
            task_id: None,
            triggers_with_actions: None,
            template_id: None,
            permissions: None,
        }
    }
}
/// The status of channel
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Status {
    #[serde(rename = "INACTIVE")]
    #[default]
    Inactive,
    #[serde(rename = "ACTIVE")]
    Active,
}
