nomad_api_types/types/
event.rs

1/*
2 * This is an auto-generated file.
3 * Any manual changes may be overwritten without notice!
4 */
5
6use derive_builder::Builder;
7use serde::{Deserialize, Serialize};
8
9/// Event holds information related to an event that occurred in Nomad.
10/// The Payload is a hydrated object related to the Topic
11///
12/// This struct was generated based on the Go types of the official Nomad API client.
13#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Builder)]
14pub struct Event {
15    #[serde(rename = "Topic")]
16    pub topic: super::Topic,
17
18    #[serde(rename = "Type")]
19    #[builder(default)]
20    pub r#type: String,
21
22    #[serde(rename = "Key")]
23    #[builder(default)]
24    pub key: String,
25
26    #[serde(
27        rename = "FilterKeys",
28        deserialize_with = "crate::deserialize_null_as_default"
29    )]
30    #[builder(default)]
31    pub filter_keys: Vec<String>,
32
33    #[serde(rename = "Index")]
34    #[builder(default)]
35    pub index: u64,
36
37    #[serde(
38        rename = "Payload",
39        deserialize_with = "crate::deserialize_null_as_default"
40    )]
41    #[builder(default)]
42    pub payload: std::collections::HashMap<String, serde_json::Value>,
43}