objectiveai_cli_sdk/output/notification/log_content.rs
1use serde::{Deserialize, Serialize};
2
3/// Contents of a log read or subscribe. Mirrors the upstream
4/// `objectiveai_sdk::filesystem::logs::LogContent` (which has no serde
5/// derives) so the wire shape is parseable in cli-lib without depending
6/// on it for serialization.
7///
8/// `Json` carries an arbitrary API payload (one of the two intentional
9/// uses of `serde_json::Value` in this module). `DataUrl` carries
10/// `data:{mime};base64,{payload}` for binary log content.
11///
12/// Wire shapes:
13/// `{"type":"notification","content":<value>}`
14/// `{"type":"notification","content_data_url":"data:..."}`
15#[derive(Serialize, Deserialize, Debug, Clone)]
16#[serde(untagged)]
17pub enum LogContent {
18 Json { content: serde_json::Value },
19 DataUrl { content_data_url: String },
20}