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};

/// EventBatchResult : Documentation-only shape of a batch ingest response.  Mirrors `apps.audit_trails.api_views._batch_response`: one entry per submitted event, in submission order, an accepted or duplicate entry carrying the stored event's id and a rejected entry carrying the error envelope instead. The response is 202 when nothing was rejected and 207 when anything was.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EventBatchResult {
    /// How many events this request indexed (including idempotent replays).
    #[serde(rename = "accepted")]
    pub accepted: i32,
    /// How many events this request rejected.
    #[serde(rename = "rejected")]
    pub rejected: i32,
    /// One result per submitted event, in submission order.
    #[serde(rename = "results")]
    pub results: Vec<models::EventBatchItemResult>,
}

impl EventBatchResult {
    /// Documentation-only shape of a batch ingest response.  Mirrors `apps.audit_trails.api_views._batch_response`: one entry per submitted event, in submission order, an accepted or duplicate entry carrying the stored event's id and a rejected entry carrying the error envelope instead. The response is 202 when nothing was rejected and 207 when anything was.
    pub fn new(accepted: i32, rejected: i32, results: Vec<models::EventBatchItemResult>) -> EventBatchResult {
        EventBatchResult {
            accepted,
            rejected,
            results,
        }
    }
}