1use serde::{Serialize, Deserialize};
2use serde_json::Value;
3
4#[derive(Serialize, Deserialize, Debug)]
5pub struct Annotations {
6 list: Vec<Value>,
7}
8
9#[derive(Serialize, Deserialize, Debug)]
10pub struct Dashboard {
11 pub annotations: Option<Annotations>,
12 pub editable: bool,
13 #[serde(rename = "gnetId")]
14 pub gnet_id: Value,
15 #[serde(rename = "graphTooltip")]
16 pub graph_tooltip: Option<i64>,
17 #[serde(rename = "hideControls")]
18 pub hide_controls: Option<bool>,
19 pub id: i64,
20 pub links: Option<Vec<Value>>,
21 pub panels: Vec<Panels>,
22 #[serde(rename = "schemaVersion")]
23 pub schema_version: i64,
24 pub style: Option<String>,
25 pub tags: Option<Vec<Value>>,
26 pub templating: Option<Annotations>,
27 pub time: Option<Time>,
28 pub timepicker: Option<Timepicker>,
29 pub timezone: Option<String>,
30 pub title: String,
31 pub uid: String,
32 pub version: i64,
33}
34
35#[derive(Serialize, Deserialize, Debug)]
36pub struct Dimensions {
37 #[serde(rename = "FunctionName")]
38 function_name: String,
39}
40
41#[derive(Serialize, Deserialize, Debug)]
42pub struct GridPos {
43 h: i64,
44 w: i64,
45 x: i64,
46 y: i64,
47}
48
49#[derive(Serialize, Deserialize, Debug)]
50pub struct Legend {
51 avg: bool,
52 current: bool,
53 max: bool,
54 min: bool,
55 show: bool,
56 total: bool,
57 values: bool,
58}
59
60#[derive(Serialize, Deserialize, Debug)]
61pub struct List {
62 #[serde(rename = "builtIn")]
63 built_in: i64,
64 datasource: String,
65 enable: bool,
66 hide: bool,
67 #[serde(rename = "iconColor")]
68 icon_color: String,
69 name: String,
70 #[serde(rename = "type")]
71 _type: String,
72}
73
74#[derive(Serialize, Deserialize, Debug)]
75pub struct Meta {
76 #[serde(rename = "type")]
77 _type: String,
78 #[serde(rename = "canSave")]
79 can_save: bool,
80 #[serde(rename = "canEdit")]
81 can_edit: bool,
82 #[serde(rename = "canAdmin")]
83 can_admin: bool,
84 #[serde(rename = "canStar")]
85 can_star: bool,
86 slug: String,
87 url: String,
88 expires: String,
89 created: String,
90 updated: String,
91 #[serde(rename = "updatedBy")]
92 updated_by: String,
93 #[serde(rename = "createdBy")]
94 created_by: String,
95 version: i64,
96 #[serde(rename = "hasAcl")]
97 has_acl: bool,
98 #[serde(rename = "isFolder")]
99 is_folder: bool,
100 #[serde(rename = "folderId")]
101 folder_id: i64,
102 #[serde(rename = "folderTitle")]
103 folder_title: String,
104 #[serde(rename = "folderUrl")]
105 folder_url: String,
106 provisioned: bool,
107}
108
109#[derive(Serialize, Deserialize, Debug)]
110pub struct Panels {
111 #[serde(rename = "aliasColors")]
112 alias_colors: Option<Value>,
113 bars: Option<bool>,
114 #[serde(rename = "dashLength")]
115 dash_length: Option<i64>,
116 dashes: Option<bool>,
117 datasource: Option<String>,
118 fill: Option<i64>,
119 #[serde(rename = "gridPos")]
120 grid_pos: Option<GridPos>,
121 id: Option<i64>,
122 legend: Option<Legend>,
123 lines: Option<bool>,
124 linewidth: Option<i64>,
125 #[serde(rename = "nullPointMode")]
126 null_point_mode: Option<String>,
127 percentage: Option<bool>,
128 pointradius: Option<i64>,
129 points: Option<bool>,
130 renderer: Option<String>,
131 #[serde(rename = "seriesOverrides")]
132 series_overrides: Option<Vec<Value>>,
133 #[serde(rename = "spaceLength")]
134 space_length: Option<i64>,
135 stack: Option<bool>,
136 #[serde(rename = "steppedLine")]
137 stepped_line: Option<bool>,
138 targets: Option<Vec<Targets>>,
139 thresholds: Option<Vec<Value>>,
140 #[serde(rename = "timeFrom")]
141 time_from: Option<Value>,
142 #[serde(rename = "timeShift")]
143 time_shift: Option<Value>,
144 title: Option<String>,
145 tooltip: Option<Tooltip>,
146 #[serde(rename = "type")]
147 _type: Option<String>,
148 xaxis: Option<Xaxis>,
149 yaxes: Option<Vec<Yaxes>>,
150 yaxis: Option<Yaxis>,
151}
152
153#[derive(Serialize, Deserialize, Debug)]
154pub struct RootInterface {
155 pub meta: Option<Meta>,
156 pub dashboard: Dashboard,
157}
158
159#[derive(Serialize, Deserialize, Debug)]
160pub struct Targets {
161 dimensions: Dimensions,
162 #[serde(rename = "highResolution")]
163 high_resolution: bool,
164 #[serde(rename = "metricName")]
165 metric_name: String,
166 namespace: String,
167 period: String,
168 #[serde(rename = "refId")]
169 ref_id: String,
170 region: String,
171 statistics: Vec<String>,
172}
173
174#[derive(Serialize, Deserialize, Debug)]
175pub struct Time {
176 from: String,
177 to: String,
178}
179
180#[derive(Serialize, Deserialize, Debug)]
181pub struct Timepicker {
182 refresh_intervals: Vec<String>,
183 time_options: Vec<String>,
184}
185
186#[derive(Serialize, Deserialize, Debug)]
187pub struct Tooltip {
188 shared: bool,
189 sort: i64,
190 value_type: String,
191}
192
193#[derive(Serialize, Deserialize, Debug)]
194pub struct Xaxis {
195 buckets: Value,
196 mode: String,
197 name: Value,
198 show: bool,
199 values: Vec<Value>,
200}
201
202#[derive(Serialize, Deserialize, Debug)]
203pub struct Yaxes {
204 format: String,
205 label: Value,
206 #[serde(rename = "logBase")]
207 log_base: i64,
208 max: Value,
209 min: Value,
210 show: bool,
211}
212
213#[derive(Serialize, Deserialize, Debug)]
214pub struct Yaxis {
215 align: bool,
216 #[serde(rename = "alignLevel")]
217 align_level: Value,
218}
219
220#[derive(Serialize, Deserialize, Debug)]
221pub struct MutateDashboardResponse {
222 pub id: i64,
223 pub slug: String,
224 pub status: String,
225 pub uid: String,
226 pub url: String,
227 pub version: i64
228}