use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Artifact {
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "node_id")]
pub node_id: String,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "size_in_bytes")]
pub size_in_bytes: i32,
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "archive_download_url")]
pub archive_download_url: String,
#[serde(rename = "expired")]
pub expired: bool,
#[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
pub created_at: Option<String>,
#[serde(rename = "expires_at", deserialize_with = "Option::deserialize")]
pub expires_at: Option<String>,
#[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
pub updated_at: Option<String>,
#[serde(rename = "workflow_run", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub workflow_run: Option<Option<Box<models::ArtifactWorkflowRun>>>,
}
impl Artifact {
pub fn new(id: i32, node_id: String, name: String, size_in_bytes: i32, url: String, archive_download_url: String, expired: bool, created_at: Option<String>, expires_at: Option<String>, updated_at: Option<String>) -> Artifact {
Artifact {
id,
node_id,
name,
size_in_bytes,
url,
archive_download_url,
expired,
created_at,
expires_at,
updated_at,
workflow_run: None,
}
}
}