1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use serde::{Deserialize, Serialize};

use crate::error::ZabbixError;

#[derive(Serialize)]
pub struct ZabbixApiRequest<T: Serialize> {
    pub jsonrpc: String,
    pub method: String,
    pub params: T,
    pub id: i8,
    pub auth: Option<String>
}

#[derive(Deserialize,Debug)]
pub struct ZabbixApiResponse<R> {
    pub jsonrpc: String,
    pub result: Option<R>,
    pub id: i8,
    pub error: Option<ZabbixError>
}