icinga2_api/types/join_types/
dependency.rs1use serde::{Deserialize, Serialize};
4
5use crate::types::monitoring_objects::{
6 host::IcingaHost, service::IcingaService, time_period::IcingaTimePeriod,
7};
8
9use super::{IcingaJoinResult, IcingaJoinType};
10
11#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
13pub enum IcingaDependencyJoinTypes {
14 ChildHost,
16 ChildService,
18 ParentHost,
20 ParentService,
22 Period,
24}
25
26impl IcingaJoinType for IcingaDependencyJoinTypes {}
27
28impl std::fmt::Display for IcingaDependencyJoinTypes {
29 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30 match self {
31 IcingaDependencyJoinTypes::ChildHost => write!(f, "child_host"),
32 IcingaDependencyJoinTypes::ChildService => write!(f, "child_service"),
33 IcingaDependencyJoinTypes::ParentHost => write!(f, "parent_host"),
34 IcingaDependencyJoinTypes::ParentService => write!(f, "parent_service"),
35 IcingaDependencyJoinTypes::Period => write!(f, "period"),
36 }
37 }
38}
39
40#[derive(Debug, Clone, Serialize, Deserialize)]
42pub struct IcingaDependencyJoins {
43 pub child_host: Option<IcingaJoinResult<IcingaHost>>,
45 pub child_service: Option<IcingaJoinResult<IcingaService>>,
47 pub parent_host: Option<IcingaJoinResult<IcingaHost>>,
49 pub parent_service: Option<IcingaJoinResult<IcingaService>>,
51 pub period: Option<IcingaJoinResult<IcingaTimePeriod>>,
53}