Skip to main content

onspring/models/
report.rs

1use serde::Deserialize;
2
3/// Represents a report associated to an app (used in list responses).
4#[derive(Debug, Clone, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct ReportInfo {
7  pub app_id: i32,
8  pub id: i32,
9  pub name: Option<String>,
10  pub description: Option<String>,
11}
12
13/// Represents the data returned by a report.
14#[derive(Debug, Clone, Deserialize)]
15#[serde(rename_all = "camelCase")]
16pub struct ReportData {
17  pub columns: Option<Vec<String>>,
18  pub rows: Option<Vec<ReportRow>>,
19}
20
21/// Represents a single row in a report.
22#[derive(Debug, Clone, Deserialize)]
23#[serde(rename_all = "camelCase")]
24pub struct ReportRow {
25  pub record_id: Option<i32>,
26  pub cells: Option<Vec<serde_json::Value>>,
27}