idiolect-records 0.4.1

Rust record types mirroring the dev.idiolect.* Lexicon family.
Documentation
// @generated by idiolect-codegen. do not edit.
// source: dev.panproto.schema.complement

//! Generated from `dev.panproto.schema.complement`.

#![allow(
    missing_docs,
    clippy::doc_markdown,
    clippy::struct_excessive_bools,
    clippy::derive_partial_eq_without_eq
)]
use serde::{Deserialize, Serialize};

/// Residual data from translating a specific record through an asymmetric lens. Stores the information the get direction stripped so that put can reconstruct the original source.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PanprotoComplement {
    /// The residual data: field values, sort data, or other content the lens set aside.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub blob: Option<serde_json::Value>,
    pub created_at: idiolect_records::Datetime,
    /// AT-URI of the lens record that produced this complement.
    pub lens: idiolect_records::AtUri,
    /// Content hash of the residual blob.
    pub object_hash: String,
    /// Content hash of the source record at translation time, for staleness detection.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub source_hash: Option<String>,
    /// AT-URI of the original source record that was translated.
    pub source_record: idiolect_records::AtUri,
    /// AT-URI of the translated target record, if it was persisted.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub target_record: Option<idiolect_records::AtUri>,
}

impl crate::Record for PanprotoComplement {
    const NSID: &'static str = "dev.panproto.schema.complement";
}