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 EventDefinition {
    /// The action name, e.g. invoice.voided.
    #[serde(rename = "action")]
    pub action: String,
    /// What this action means, for the people reading the catalog.
    #[serde(rename = "description")]
    pub description: String,
    /// Target types an event with this action may name; empty means any target type.
    #[serde(rename = "allowed_target_types")]
    pub allowed_target_types: Vec<String>,
    /// True while the action is in force. A definition that is not active is treated as undefined when a team has any definitions at all.
    #[serde(rename = "is_active")]
    pub is_active: bool,
    /// When the action was first defined.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// When the definition was last changed.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl EventDefinition {
    pub fn new(action: String, description: String, allowed_target_types: Vec<String>, is_active: bool, created_at: String, updated_at: String) -> EventDefinition {
        EventDefinition {
            action,
            description,
            allowed_target_types,
            is_active,
            created_at,
            updated_at,
        }
    }
}