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::*;

/// A pending approval request raised by the daemon when a guarded action requires explicit human approval.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ApprovalRequest {
    /// Version of the approval-request schema itself.
    pub request_version: ApprovalRequest_RequestVersion,
    /// Stable identifier for this pending request.
    pub id: String,
    /// Actor requesting the action.
    pub actor: ActorId,
    /// Action name the actor is attempting.
    pub action: ActionName,
    /// Optional target (path, URL, etc.) the action would affect.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub target: Option<String>,
    /// Danger categories the guard surfaced for this request.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub danger_tags: Option<Vec<DangerTag>>,
    /// Human-readable explanation of why approval is needed.
    pub reason: String,
    /// When the request was enqueued.
    pub created_at: Timestamp,
    /// When the request will be auto-denied.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub expires_at: Option<Timestamp>,
}

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