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 SchemaCheckFailure {
    /// The stored event that fails the document.
    #[serde(rename = "event_id")]
    pub event_id: String,
    /// When the event occurred.
    #[serde(rename = "occurred_at")]
    pub occurred_at: String,
    /// The dotted path of the offending value, or null for the root.
    #[serde(rename = "field", deserialize_with = "Option::deserialize")]
    pub field: Option<String>,
    /// What the document rejected.
    #[serde(rename = "message")]
    pub message: String,
}

impl SchemaCheckFailure {
    pub fn new(event_id: String, occurred_at: String, field: Option<String>, message: String) -> SchemaCheckFailure {
        SchemaCheckFailure {
            event_id,
            occurred_at,
            field,
            message,
        }
    }
}