tapis-streams 0.3.0

Manage Tapis Streams API.
Documentation
/*
 * 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 UpdateChannel {
    /// User defined channel name.
    #[serde(rename = "channel_name")]
    pub channel_name: String,
    /// Template id. (public templates include default_threshold or default_deadman)
    #[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
    pub template_id: Option<String>,
    /// Type of Checks (threshold or deadman)
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
    #[serde(
        rename = "triggers_with_actions",
        skip_serializing_if = "Option::is_none"
    )]
    pub triggers_with_actions: Option<Vec<models::NewChannelTriggersWithActionsInner>>,
}

impl UpdateChannel {
    pub fn new(channel_name: String) -> UpdateChannel {
        UpdateChannel {
            channel_name,
            template_id: None,
            r#type: None,
            triggers_with_actions: None,
        }
    }
}
/// Type of Checks (threshold or deadman)
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Type {
    #[serde(rename = "threshold")]
    #[default]
    Threshold,
    #[serde(rename = "deadman")]
    Deadman,
}