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