use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeviceFactSnapshot {
#[serde(rename = "data")]
pub data: models::DeviceFacts,
#[serde(rename = "connection")]
pub connection: uuid::Uuid,
#[serde(rename = "created")]
pub created: String,
#[serde(rename = "expires", deserialize_with = "Option::deserialize")]
pub expires: Option<String>,
#[serde(rename = "vendor")]
pub vendor: models::VendorEnum,
}
impl DeviceFactSnapshot {
pub fn new(
data: models::DeviceFacts,
connection: uuid::Uuid,
created: String,
expires: Option<String>,
vendor: models::VendorEnum,
) -> DeviceFactSnapshot {
DeviceFactSnapshot {
data,
connection,
created,
expires,
vendor,
}
}
}