openapi_github/models/
nullable_milestone.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/// NullableMilestone : A collection of related issues and pull requests.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableMilestone {
17    #[serde(rename = "url")]
18    pub url: String,
19    #[serde(rename = "html_url")]
20    pub html_url: String,
21    #[serde(rename = "labels_url")]
22    pub labels_url: String,
23    #[serde(rename = "id")]
24    pub id: i32,
25    #[serde(rename = "node_id")]
26    pub node_id: String,
27    /// The number of the milestone.
28    #[serde(rename = "number")]
29    pub number: i32,
30    /// The state of the milestone.
31    #[serde(rename = "state")]
32    pub state: State,
33    /// The title of the milestone.
34    #[serde(rename = "title")]
35    pub title: String,
36    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
37    pub description: Option<String>,
38    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
39    pub creator: Option<Box<models::NullableSimpleUser>>,
40    #[serde(rename = "open_issues")]
41    pub open_issues: i32,
42    #[serde(rename = "closed_issues")]
43    pub closed_issues: i32,
44    #[serde(rename = "created_at")]
45    pub created_at: String,
46    #[serde(rename = "updated_at")]
47    pub updated_at: String,
48    #[serde(rename = "closed_at", deserialize_with = "Option::deserialize")]
49    pub closed_at: Option<String>,
50    #[serde(rename = "due_on", deserialize_with = "Option::deserialize")]
51    pub due_on: Option<String>,
52}
53
54impl NullableMilestone {
55    /// A collection of related issues and pull requests.
56    pub fn new(url: String, html_url: String, labels_url: String, id: i32, node_id: String, number: i32, state: State, title: String, description: Option<String>, creator: Option<models::NullableSimpleUser>, open_issues: i32, closed_issues: i32, created_at: String, updated_at: String, closed_at: Option<String>, due_on: Option<String>) -> NullableMilestone {
57        NullableMilestone {
58            url,
59            html_url,
60            labels_url,
61            id,
62            node_id,
63            number,
64            state,
65            title,
66            description,
67            creator: creator.map(Box::new),
68            open_issues,
69            closed_issues,
70            created_at,
71            updated_at,
72            closed_at,
73            due_on,
74        }
75    }
76}
77/// The state of the milestone.
78#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum State {
80    #[serde(rename = "open")]
81    Open,
82    #[serde(rename = "closed")]
83    Closed,
84}
85
86impl Default for State {
87    fn default() -> State {
88        Self::Open
89    }
90}
91