idiolect-records 0.7.0

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

//! A community's bundle of idiolect references and preferred translations. Dialects are declared, not imposed; downstream consumers may adopt, adapt, or ignore them per P1.

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

/// A dialect is a coherent bundle of schema choices and translations a community has converged on. It is the community-level analog of an idiolect.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Dialect {
    pub created_at: idiolect_records::Datetime,
    /// Idiolect or lens references that were once part of this dialect and are now deprecated. Retained for migration and traceability.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub deprecations: Option<Vec<DialectDeprecations>>,
    /// Purpose and scope of this dialect.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The schemas that constitute this dialect's idiolect set.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub idiolects: Option<Vec<crate::generated::dev::idiolect::defs::SchemaRef>>,
    /// Human-readable dialect name.
    pub name: String,
    /// The community that owns this dialect.
    pub owning_community: idiolect_records::AtUri,
    /// Translations the community prefers when mapping between its idiolects and external schemas.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub preferred_lenses: Option<Vec<crate::generated::dev::idiolect::defs::LensRef>>,
    /// AT-URI of the immediately preceding dialect revision, forming a version chain.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub previous_version: Option<idiolect_records::AtUri>,
    /// Dialect version (semver when applicable).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,
}

impl crate::Record for Dialect {
    const NSID: &'static str = "dev.idiolect.dialect";
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DialectDeprecations {
    pub deprecated_at: idiolect_records::Datetime,
    pub reason: String,
    /// The deprecated idiolect or lens.
    pub r#ref: idiolect_records::AtUri,
    /// Optional successor.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub replacement: Option<idiolect_records::AtUri>,
}