tf-types 0.1.6

Core semantic types, traits, and schemas powering the TrustForge protocol.
Documentation
// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.

#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]

use serde::{Deserialize, Serialize};
use super::*;

/// Revocation record that invalidates a capability, actor, delegation, or instance (TF-0004).
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Revocation {
    /// Version of the revocation schema itself.
    pub revocation_version: Revocation_RevocationVersion,
    /// Stable identifier for this revocation.
    pub id: String,
    /// Identifier of the object being revoked (depends on target_kind).
    pub target_id: String,
    /// Kind of object being revoked.
    pub target_kind: Revocation_TargetKind,
    /// When the revocation becomes effective.
    pub effective_at: Timestamp,
    /// Human-readable reason for the revocation.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reason: Option<String>,
    /// Whether a future identity or grant could reuse this target_id.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub reinstatement_possible: Option<bool>,
    /// Actor issuing this revocation.
    pub issuer: ActorId,
    /// Signature envelope over the canonical form of this revocation (not verified in the foundation phase).
    pub signature: SignatureEnvelope,
}

/// Version of the revocation schema itself.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Revocation_RevocationVersion {
    #[serde(rename = "1")]
    V1,
}

/// Kind of object being revoked.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Revocation_TargetKind {
    #[serde(rename = "capability")]
    Capability,
    #[serde(rename = "actor")]
    Actor,
    #[serde(rename = "delegation")]
    Delegation,
    #[serde(rename = "instance")]
    Instance,
}