antimatter_api 2.0.13

Interact with the Antimatter Cloud API
Documentation
/*
 * Antimatter Public API
 *
 * Interact with the Antimatter Cloud API
 *
 * The version of the OpenAPI document: 2.0.13
 * Contact: support@antimatter.io
 * Generated by: https://openapi-generator.tech
 */

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

/// AccessLogEntry : An individual capsule data-plane log entry. If adding a new read log entry, the session should  be omitted (the server will fill it in) 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccessLogEntry {
    /// A globally unique chronological identifier for a log record. If you sort by this identifier, your logs will be in chronological order 
    #[serde(rename = "id")]
    pub id: String,
    /// the time of a read operation, in UTC
    #[serde(rename = "time")]
    pub time: String,
    /// A globally unique identifier for a domain
    #[serde(rename = "domain")]
    pub domain: String,
    /// A globally unique identifier for a capsule
    #[serde(rename = "capsule")]
    pub capsule: String,
    #[serde(rename = "operation")]
    pub operation: Operation,
    /// An identifier for an authentication session
    #[serde(rename = "session")]
    pub session: String,
    /// the location URL that this capsule resided in during the operation, if known 
    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,
    #[serde(rename = "createInfo", skip_serializing_if = "Option::is_none")]
    pub create_info: Option<Box<models::AccessLogEntryCreateInfo>>,
    #[serde(rename = "openInfo", skip_serializing_if = "Option::is_none")]
    pub open_info: Option<Box<models::AccessLogEntryOpenInfo>>,
    #[serde(rename = "readInfo", skip_serializing_if = "Option::is_none")]
    pub read_info: Option<Box<models::AccessLogEntryReadInfo>>,
    #[serde(rename = "capsuleTags")]
    pub capsule_tags: Vec<models::Tag>,
    #[serde(rename = "capsuleSpanTags")]
    pub capsule_span_tags: Box<models::TagSummary>,
    /// how big this capsule is
    #[serde(rename = "capsuleSize")]
    pub capsule_size: i64,
    /// when this capsule was created
    #[serde(rename = "capsuleCreated")]
    pub capsule_created: String,
    /// the principal's issuer
    #[serde(rename = "issuer")]
    pub issuer: String,
    /// the principal for this operation
    #[serde(rename = "principal")]
    pub principal: String,
}

impl AccessLogEntry {
    /// An individual capsule data-plane log entry. If adding a new read log entry, the session should  be omitted (the server will fill it in) 
    pub fn new(id: String, time: String, domain: String, capsule: String, operation: Operation, session: String, capsule_tags: Vec<models::Tag>, capsule_span_tags: models::TagSummary, capsule_size: i64, capsule_created: String, issuer: String, principal: String) -> AccessLogEntry {
        AccessLogEntry {
            id,
            time,
            domain,
            capsule,
            operation,
            session,
            location: None,
            create_info: None,
            open_info: None,
            read_info: None,
            capsule_tags,
            capsule_span_tags: Box::new(capsule_span_tags),
            capsule_size,
            capsule_created,
            issuer,
            principal,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Operation {
    #[serde(rename = "open")]
    Open,
    #[serde(rename = "read")]
    Read,
    #[serde(rename = "create")]
    Create,
}

impl Default for Operation {
    fn default() -> Operation {
        Self::Open
    }
}