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 EventSchemaVersion {
    /// The per-action version number; never reused, even after a draft is deleted.
    #[serde(rename = "version")]
    pub version: i32,
    /// draft: editable, validates nothing. published: immutable, validates ingest. deprecated: a newer version superseded it; pinned producers are accepted until `deprecation_deadline`.  * `draft` - Draft * `published` - Published * `deprecated` - Deprecated
    #[serde(rename = "status")]
    pub status: String,
    /// The JSON Schema 2020-12 document. It validates the event's `metadata`, `actor.metadata` and each `targets[].metadata`; metadata values are always strings.
    #[serde(rename = "schema")]
    pub schema: std::collections::HashMap<String, serde_json::Value>,
    /// When the version was published; null for a draft.
    #[serde(rename = "published_at", deserialize_with = "Option::deserialize")]
    pub published_at: Option<String>,
    /// When a newer version superseded this one; null until then.
    #[serde(rename = "deprecated_at", deserialize_with = "Option::deserialize")]
    pub deprecated_at: Option<String>,
    /// When a deprecated version stops accepting pinned traffic; null while it is not deprecated.
    #[serde(rename = "deprecation_deadline", deserialize_with = "Option::deserialize")]
    pub deprecation_deadline: Option<String>,
    /// When the draft was first created.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// When the version last changed. The `ETag` tracks it.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl EventSchemaVersion {
    pub fn new(version: i32, status: String, schema: std::collections::HashMap<String, serde_json::Value>, published_at: Option<String>, deprecated_at: Option<String>, deprecation_deadline: Option<String>, created_at: String, updated_at: String) -> EventSchemaVersion {
        EventSchemaVersion {
            version,
            status,
            schema,
            published_at,
            deprecated_at,
            deprecation_deadline,
            created_at,
            updated_at,
        }
    }
}