apisix_admin_client/models/
common.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use serde::{Deserialize, Serialize};
use serde_json::Value;

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ListResponse<T> {
    #[serde(rename = "list")]
    pub list: Vec<T>,
    pub total: i32,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GenericJsonResponse {
    pub created_index: i64,
    pub key: String,
    pub value: Value,
    pub modified_index: i64,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TypedItem<T> {
    pub created_index: Option<i64>,
    pub key: Option<String>,
    pub value: Option<T>,
    pub modified_index: Option<i64>,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApisixTimeout {
    pub connect: Option<f32>,
    pub send: Option<f32>,
    pub read: Option<f32>,
}