icinga2_api/types/
names.rs

1//! type-safe names for various icinga objects
2
3use serde::{Deserialize, Serialize};
4
5/// a check command name
6#[derive(
7    Debug,
8    Clone,
9    Hash,
10    PartialEq,
11    Eq,
12    PartialOrd,
13    Ord,
14    Serialize,
15    Deserialize,
16    derive_more::Display,
17    derive_more::FromStr,
18)]
19pub struct IcingaCheckCommandName(pub String);
20
21/// a downtime name
22#[derive(
23    Debug,
24    Clone,
25    Hash,
26    PartialEq,
27    Eq,
28    PartialOrd,
29    Ord,
30    Serialize,
31    Deserialize,
32    derive_more::Display,
33    derive_more::FromStr,
34)]
35pub struct IcingaDowntimeName(pub String);
36
37/// an endpoint name
38#[derive(
39    Debug,
40    Clone,
41    Hash,
42    PartialEq,
43    Eq,
44    PartialOrd,
45    Ord,
46    Serialize,
47    Deserialize,
48    derive_more::Display,
49    derive_more::FromStr,
50)]
51pub struct IcingaEndpointName(pub String);
52
53/// an event command name
54#[derive(
55    Debug,
56    Clone,
57    Hash,
58    PartialEq,
59    Eq,
60    PartialOrd,
61    Ord,
62    Serialize,
63    Deserialize,
64    derive_more::Display,
65    derive_more::FromStr,
66)]
67pub struct IcingaEventCommandName(pub String);
68
69/// a host name
70#[derive(
71    Debug,
72    Clone,
73    Hash,
74    PartialEq,
75    Eq,
76    PartialOrd,
77    Ord,
78    Serialize,
79    Deserialize,
80    derive_more::Display,
81    derive_more::FromStr,
82)]
83pub struct IcingaHostName(pub String);
84
85/// a host group name
86#[derive(
87    Debug,
88    Clone,
89    Hash,
90    PartialEq,
91    Eq,
92    PartialOrd,
93    Ord,
94    Serialize,
95    Deserialize,
96    derive_more::Display,
97    derive_more::FromStr,
98)]
99pub struct IcingaHostGroupName(pub String);
100
101/// a notification command name
102#[derive(
103    Debug,
104    Clone,
105    Hash,
106    PartialEq,
107    Eq,
108    PartialOrd,
109    Ord,
110    Serialize,
111    Deserialize,
112    derive_more::Display,
113    derive_more::FromStr,
114)]
115pub struct IcingaNotificationCommandName(pub String);
116
117/// a package name
118#[derive(
119    Debug,
120    Clone,
121    Hash,
122    PartialEq,
123    Eq,
124    PartialOrd,
125    Ord,
126    Serialize,
127    Deserialize,
128    derive_more::Display,
129    derive_more::FromStr,
130)]
131pub struct IcingaPackageName(pub String);
132
133/// a scheduled downtime name
134#[derive(
135    Debug,
136    Clone,
137    Hash,
138    PartialEq,
139    Eq,
140    PartialOrd,
141    Ord,
142    Serialize,
143    Deserialize,
144    derive_more::Display,
145    derive_more::FromStr,
146)]
147pub struct IcingaScheduledDowntimeName(pub String);
148
149/// a service name
150#[derive(
151    Debug,
152    Clone,
153    Hash,
154    PartialEq,
155    Eq,
156    PartialOrd,
157    Ord,
158    Serialize,
159    Deserialize,
160    derive_more::Display,
161    derive_more::FromStr,
162)]
163pub struct IcingaServiceName(pub String);
164
165/// a service group name
166#[derive(
167    Debug,
168    Clone,
169    Hash,
170    PartialEq,
171    Eq,
172    PartialOrd,
173    Ord,
174    Serialize,
175    Deserialize,
176    derive_more::Display,
177    derive_more::FromStr,
178)]
179pub struct IcingaServiceGroupName(pub String);
180
181/// a template name
182#[derive(
183    Debug,
184    Clone,
185    Hash,
186    PartialEq,
187    Eq,
188    PartialOrd,
189    Ord,
190    Serialize,
191    Deserialize,
192    derive_more::Display,
193    derive_more::FromStr,
194)]
195pub struct IcingaTemplateName(pub String);
196
197/// a time period name
198#[derive(
199    Debug,
200    Clone,
201    Hash,
202    PartialEq,
203    Eq,
204    PartialOrd,
205    Ord,
206    Serialize,
207    Deserialize,
208    derive_more::Display,
209    derive_more::FromStr,
210)]
211pub struct IcingaTimePeriodName(pub String);
212
213/// a user name
214#[derive(
215    Debug,
216    Clone,
217    Hash,
218    PartialEq,
219    Eq,
220    PartialOrd,
221    Ord,
222    Serialize,
223    Deserialize,
224    derive_more::Display,
225    derive_more::FromStr,
226)]
227pub struct IcingaUserName(pub String);
228
229/// a user group name
230#[derive(
231    Debug,
232    Clone,
233    Hash,
234    PartialEq,
235    Eq,
236    PartialOrd,
237    Ord,
238    Serialize,
239    Deserialize,
240    derive_more::Display,
241    derive_more::FromStr,
242)]
243pub struct IcingaUserGroupName(pub String);
244
245/// a zone name
246#[derive(
247    Debug,
248    Clone,
249    Hash,
250    PartialEq,
251    Eq,
252    PartialOrd,
253    Ord,
254    Serialize,
255    Deserialize,
256    derive_more::Display,
257    derive_more::FromStr,
258)]
259pub struct IcingaZoneName(pub String);