santati 0.1.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.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// EventBatchItemResult : One batch result item: accepted or duplicate items carry id, rejected items carry error.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EventBatchItemResult {
    #[serde(rename = "index")]
    pub index: i32,
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<models::ErrorBody>,
}

impl EventBatchItemResult {
    /// One batch result item: accepted or duplicate items carry id, rejected items carry error.
    pub fn new(index: i32, status: Status) -> EventBatchItemResult {
        EventBatchItemResult {
            index,
            status,
            id: None,
            error: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "accepted")]
    Accepted,
    #[serde(rename = "duplicate")]
    Duplicate,
    #[serde(rename = "rejected")]
    Rejected,
}

impl Default for Status {
    fn default() -> Status {
        Self::Accepted
    }
}