use std::path::PathBuf;
use getset::{Getters, Setters};
use super::{artifact_assets::ArtifactAssets, Artifact, ArtifactError};
#[derive(Debug, Getters, Setters)]
pub struct ArtifactsCollection {
#[getset(get = "pub", set = "pub")]
assets: Option<ArtifactAssets>,
#[getset(get = "pub", set = "pub")]
artifacts: Vec<Artifact>,
#[getset(get = "pub", set = "pub")]
output_path: PathBuf
}
#[allow(dead_code)]
impl ArtifactsCollection {
pub fn new(output_path: PathBuf) -> Result<Self, ArtifactError> {
if !output_path.is_dir() {
return Err(ArtifactError::OutputPathNotDir)
}
Ok(Self {
assets: Option::None,
artifacts: Vec::new(),
output_path
})
}
}