/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebsocketHeartbeat {
    /// Interval in seconds between heartbeat messages
    #[serde(rename = "interval_secs")]
    pub interval_secs: i32,
    /// Message to send as heartbeat. Use {{state}} as a placeholder for a value extracted from incoming messages (see state_field).
    #[serde(rename = "message")]
    pub message: String,
    /// Optional. Top-level JSON field to extract from incoming messages. The extracted value replaces {{state}} in the heartbeat message.
    #[serde(rename = "state_field", skip_serializing_if = "Option::is_none")]
    pub state_field: Option<String>,
}

impl WebsocketHeartbeat {
    pub fn new(interval_secs: i32, message: String) -> WebsocketHeartbeat {
        WebsocketHeartbeat {
            interval_secs,
            message,
            state_field: None,
        }
    }
}

