santati 0.3.0

Official Rust SDK for the Santati audit-log API
Documentation
/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct StandardEvent {
    /// The action name, e.g. agent.tool.called.
    #[serde(rename = "action")]
    pub action: String,
    /// What the action means.
    #[serde(rename = "description")]
    pub description: String,
    /// Target types installed as the action's allowed target types; empty means any.
    #[serde(rename = "target_types")]
    pub target_types: Vec<String>,
    /// Metadata keys every event with this action must carry.
    #[serde(rename = "required_metadata")]
    pub required_metadata: Vec<String>,
    /// Metadata keys the schema declares as strings but does not require.
    #[serde(rename = "optional_metadata")]
    pub optional_metadata: Vec<String>,
    /// The JSON Schema 2020-12 document installed as the action's published v1.
    #[serde(rename = "schema")]
    pub schema: std::collections::HashMap<String, serde_json::Value>,
    /// The action's OCSF class and activity.
    #[serde(rename = "ocsf")]
    pub ocsf: models::OcsfMapping,
}

impl StandardEvent {
    pub fn new(action: String, description: String, target_types: Vec<String>, required_metadata: Vec<String>, optional_metadata: Vec<String>, schema: std::collections::HashMap<String, serde_json::Value>, ocsf: models::OcsfMapping) -> StandardEvent {
        StandardEvent {
            action,
            description,
            target_types,
            required_metadata,
            optional_metadata,
            schema,
            ocsf,
        }
    }
}