use serde::{Deserialize,Serialize};
use uuid::Uuid;
use crate::time::UtcTimestamp;
use crate::time::now_utc;
#[derive(Debug,Serialize,Deserialize)]
pub struct Agent {
pub name: String,
pub uuid: Uuid,
pub http_user_agent: Option<String>,
pub time_started: UtcTimestamp,
pub time_finished: Option<UtcTimestamp>,
}
impl Agent {
pub fn new(name: String, http_user_agent: Option<String>) -> Self {
Self {
name: name,
uuid: Uuid::now_v7(),
http_user_agent: http_user_agent,
time_started: now_utc(),
time_finished: None,
}
}
}