didwebvh_rs/log_entry/
spec_1_0_pre.rs1use chrono::{DateTime, FixedOffset};
6use serde::{Deserialize, Serialize};
7use serde_json::Value;
8
9use crate::{
10 DIDWebVHError,
11 log_entry::{LogEntry, LogEntryCreate, format_version_time, impl_log_entry_common},
12 parameters::{Parameters, spec_1_0_pre::Parameters1_0Pre},
13};
14
15#[derive(Clone, Debug, Deserialize, Serialize)]
18#[serde(rename_all = "camelCase")]
19pub struct LogEntry1_0Pre {
20 pub version_id: String,
22
23 #[serde(serialize_with = "format_version_time")]
25 pub version_time: DateTime<FixedOffset>,
26
27 pub parameters: Parameters1_0Pre,
29
30 pub state: Value,
32
33 #[serde(skip_serializing_if = "Vec::is_empty", default)]
35 pub proof: Vec<affinidi_data_integrity::DataIntegrityProof>,
36}
37
38impl_log_entry_common!(LogEntry1_0Pre);
39
40impl LogEntryCreate for LogEntry1_0Pre {
41 fn create(
42 _: String,
43 _: DateTime<FixedOffset>,
44 _: Parameters,
45 _: Value,
46 ) -> Result<LogEntry, DIDWebVHError> {
47 Err(DIDWebVHError::LogEntryError(
48 "LogEntry1_0Pre cannot be created directly. Use LogEntry1_0Pre::new() instead."
49 .to_string(),
50 ))
51 }
52}