1use serde::Serialize;
2
3#[derive(Serialize,Debug)]
5pub struct GetItemsRequestById<R> {
6 pub output: String,
7 pub with_triggers: bool,
8 #[serde(rename = "hostids")]
9 pub host_ids: String,
10 pub search: R,
11 #[serde(rename = "sortfield")]
12 pub sort_field: String
13}
14
15#[derive(Serialize,Debug)]
17pub struct GetItemsRequestByKey<R> {
18 pub output: String,
19 pub with_triggers: bool,
20 pub search: R,
21 #[serde(rename = "sortfield")]
22 pub sort_field: String
23}
24
25#[derive(Serialize,Debug)]
26pub struct SearchByKey {
27 pub key_: String,
28}
29
30impl GetItemsRequestByKey<SearchByKey> {
31 pub fn new(key: &str) -> GetItemsRequestByKey<SearchByKey> {
32 GetItemsRequestByKey {
33 output: "extend".to_string(),
34 with_triggers: false,
35 search: SearchByKey {
36 key_: key.to_string(),
37 },
38 sort_field: "name".to_string(),
39 }
40 }
41}