openapi_github/models/
projects_v2_item.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/// ProjectsV2Item : An item belonging to a project
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProjectsV2Item {
17    #[serde(rename = "id")]
18    pub id: f64,
19    #[serde(rename = "node_id", skip_serializing_if = "Option::is_none")]
20    pub node_id: Option<String>,
21    #[serde(rename = "project_node_id", skip_serializing_if = "Option::is_none")]
22    pub project_node_id: Option<String>,
23    #[serde(rename = "content_node_id")]
24    pub content_node_id: String,
25    #[serde(rename = "content_type")]
26    pub content_type: models::ProjectsV2ItemContentType,
27    #[serde(rename = "creator", skip_serializing_if = "Option::is_none")]
28    pub creator: Option<Box<models::SimpleUser>>,
29    #[serde(rename = "created_at")]
30    pub created_at: String,
31    #[serde(rename = "updated_at")]
32    pub updated_at: String,
33    #[serde(rename = "archived_at", deserialize_with = "Option::deserialize")]
34    pub archived_at: Option<String>,
35}
36
37impl ProjectsV2Item {
38    /// An item belonging to a project
39    pub fn new(id: f64, content_node_id: String, content_type: models::ProjectsV2ItemContentType, created_at: String, updated_at: String, archived_at: Option<String>) -> ProjectsV2Item {
40        ProjectsV2Item {
41            id,
42            node_id: None,
43            project_node_id: None,
44            content_node_id,
45            content_type,
46            creator: None,
47            created_at,
48            updated_at,
49            archived_at,
50        }
51    }
52}
53