hanzo_client/models/collab_payload.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CollabPayload {
16 /// Content maps a document field to its ProseMirror markup JSON.
17 #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
18 pub content: Option<std::collections::HashMap<String, String>>,
19 /// Source is the blob ref a getContent reads the snapshot from. Absent means there is no snapshot to read, which answers empty content.
20 #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
21 pub source: Option<String>,
22 /// Updates carries, per field, a base64 Y.js state update encoding the SAME markup — the front computes it (markupToYDoc → encodeStateAsUpdate) so a createContent seeds the live-editing lane's update log, not just the snapshot blob. Without it a dialog-created description is invisible in the collaborative editor, which replays the ydoc log, never the snapshot.
23 #[serde(rename = "updates", skip_serializing_if = "Option::is_none")]
24 pub updates: Option<std::collections::HashMap<String, String>>,
25}
26
27impl CollabPayload {
28 pub fn new() -> CollabPayload {
29 CollabPayload {
30 content: None,
31 source: None,
32 updates: None,
33 }
34 }
35}
36