/*
 * This is an auto-generated file.
 * Any manual changes may be overwritten without notice!
 */

use derive_builder::Builder;
use serde::{Deserialize, Serialize};

/// Event holds information related to an event that occurred in Nomad.
/// The Payload is a hydrated object related to the Topic
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct Event {
    #[serde(rename = "Topic")]
    pub topic: String,

    #[serde(rename = "Type")]
    pub r#type: String,

    #[serde(rename = "Key")]
    pub key: String,

    #[serde(
        rename = "FilterKeys",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub filter_keys: Vec<String>,

    #[serde(rename = "Index")]
    pub index: u64,

    #[serde(rename = "Payload")]
    pub payload: std::collections::HashMap<String, serde_json::Value>,
}
