/*
* Santati
*
* Santati's HTTP API. Operations under `/api/v0/` take a team API key in `Authorization: Api-Key <key>`; a missing, invalid or under-scoped key is answered with `403`, never `401`. Errors on `/api/v0/` use one of three bodies: `ErrorDetail` (`{\"detail\": ...}`), `FieldErrors` (messages keyed by request field) or `ErrorEnvelope` (`{\"error\": {\"code\", \"message\", \"field\"}}`, returned by event ingestion and log stream quota checks). Lists on `/api/v0/` are cursor-paginated: follow `next` until it is `null`.
*
* The version of the OpenAPI document: 0.3.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EventActor : Who acted, in the producer's own ids. Documentation-only on the write path — `apps.audit_trails.ingest` is the validator — and the shape `AuditEventSerializer.get_actor` always returns, so every key is present on a read even when the producer sent none of them.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EventActor {
/// Actor kind: user, system, agent or anonymous. The relay path stores whatever Ankusa relayed.
#[serde(rename = "type")]
pub r#type: String,
/// The actor's id in the producer's own namespace; required unless `type` is anonymous.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Human-readable actor name; empty when unknown.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Actor metadata: at most 50 keys, each at most 40 characters of A-Z a-z 0-9 _ . -, each value at most 500 characters. An agent acting for someone sets on_behalf_of_type and on_behalf_of_id.
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
}
impl EventActor {
/// Who acted, in the producer's own ids. Documentation-only on the write path — `apps.audit_trails.ingest` is the validator — and the shape `AuditEventSerializer.get_actor` always returns, so every key is present on a read even when the producer sent none of them.
pub fn new(r#type: String) -> EventActor {
EventActor {
r#type,
id: None,
name: None,
metadata: None,
}
}
}