Skip to main content

zlayer_types/api/
audit.rs

1//! Audit log API DTOs.
2
3use chrono::{DateTime, Utc};
4use serde::Deserialize;
5use utoipa::IntoParams;
6
7/// Query parameters for `GET /api/v1/audit`.
8#[derive(Debug, Deserialize, IntoParams)]
9pub struct AuditQuery {
10    /// Filter by user id.
11    #[serde(default)]
12    pub user: Option<String>,
13    /// Filter by resource kind.
14    #[serde(default)]
15    pub resource_kind: Option<String>,
16    /// Only entries at or after this timestamp (RFC 3339).
17    #[serde(default)]
18    #[param(value_type = Option<String>)]
19    pub since: Option<DateTime<Utc>>,
20    /// Only entries at or before this timestamp (RFC 3339).
21    #[serde(default)]
22    #[param(value_type = Option<String>)]
23    pub until: Option<DateTime<Utc>>,
24    /// Maximum number of entries to return (default 100).
25    #[serde(default)]
26    pub limit: Option<usize>,
27}