use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use super::*;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SoftwarePackageFile {
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub time_modified: Option<DateTime<Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub checksum: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub checksum_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size_in_bytes: Option<i64>,
}
impl SoftwarePackageFile {
pub fn new() -> Self {
Self {
path: None,
r#type: None,
time_modified: None,
checksum: None,
checksum_type: None,
size_in_bytes: None,
}
}
pub fn set_path(mut self, value: Option<String>) -> Self {
self.path = value;
self
}
pub fn set_type(mut self, value: Option<String>) -> Self {
self.r#type = value;
self
}
pub fn set_time_modified(mut self, value: Option<DateTime<Utc>>) -> Self {
self.time_modified = value;
self
}
pub fn set_checksum(mut self, value: Option<String>) -> Self {
self.checksum = value;
self
}
pub fn set_checksum_type(mut self, value: Option<String>) -> Self {
self.checksum_type = value;
self
}
pub fn set_size_in_bytes(mut self, value: Option<i64>) -> Self {
self.size_in_bytes = value;
self
}
pub fn with_path(mut self, value: impl Into<String>) -> Self {
self.path = Some(value.into());
self
}
pub fn with_type(mut self, value: impl Into<String>) -> Self {
self.r#type = Some(value.into());
self
}
pub fn with_time_modified(mut self, value: DateTime<Utc>) -> Self {
self.time_modified = Some(value);
self
}
pub fn with_checksum(mut self, value: impl Into<String>) -> Self {
self.checksum = Some(value.into());
self
}
pub fn with_checksum_type(mut self, value: impl Into<String>) -> Self {
self.checksum_type = Some(value.into());
self
}
pub fn with_size_in_bytes(mut self, value: i64) -> Self {
self.size_in_bytes = Some(value);
self
}
}
impl Default for SoftwarePackageFile {
fn default() -> Self {
Self::new()
}
}