1use serde::{Deserialize, Serialize};
4
5use crate::component::PropertyWrite;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct UpdateRequest {
9 #[serde(rename = "_token", default)]
10 pub csrf_token: Option<String>,
11 pub components: Vec<ComponentUpdate>,
12}
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
15pub struct ComponentUpdate {
16 pub snapshot: String,
17 #[serde(default)]
18 pub updates: Vec<PropertyWrite>,
19 #[serde(default)]
20 pub calls: Vec<ComponentCall>,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24pub struct ComponentCall {
25 pub method: String,
26 #[serde(default)]
27 pub params: Vec<serde_json::Value>,
28 #[serde(default, skip_serializing_if = "Option::is_none")]
29 pub island: Option<String>,
30}