openapi_github/models/
artifact.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Artifact : An artifact
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Artifact {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "node_id")]
20    pub node_id: String,
21    /// The name of the artifact.
22    #[serde(rename = "name")]
23    pub name: String,
24    /// The size in bytes of the artifact.
25    #[serde(rename = "size_in_bytes")]
26    pub size_in_bytes: i32,
27    #[serde(rename = "url")]
28    pub url: String,
29    #[serde(rename = "archive_download_url")]
30    pub archive_download_url: String,
31    /// Whether or not the artifact has expired.
32    #[serde(rename = "expired")]
33    pub expired: bool,
34    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
35    pub created_at: Option<String>,
36    #[serde(rename = "expires_at", deserialize_with = "Option::deserialize")]
37    pub expires_at: Option<String>,
38    #[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
39    pub updated_at: Option<String>,
40    #[serde(rename = "workflow_run", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub workflow_run: Option<Option<Box<models::ArtifactWorkflowRun>>>,
42}
43
44impl Artifact {
45    /// An artifact
46    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 {
47        Artifact {
48            id,
49            node_id,
50            name,
51            size_in_bytes,
52            url,
53            archive_download_url,
54            expired,
55            created_at,
56            expires_at,
57            updated_at,
58            workflow_run: None,
59        }
60    }
61}
62