openapi_github/models/
nullable_issue.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/// NullableIssue : Issues are a great way to keep track of tasks, enhancements, and bugs for your projects.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableIssue {
17    #[serde(rename = "id")]
18    pub id: i64,
19    #[serde(rename = "node_id")]
20    pub node_id: String,
21    /// URL for the issue
22    #[serde(rename = "url")]
23    pub url: String,
24    #[serde(rename = "repository_url")]
25    pub repository_url: String,
26    #[serde(rename = "labels_url")]
27    pub labels_url: String,
28    #[serde(rename = "comments_url")]
29    pub comments_url: String,
30    #[serde(rename = "events_url")]
31    pub events_url: String,
32    #[serde(rename = "html_url")]
33    pub html_url: String,
34    /// Number uniquely identifying the issue within its repository
35    #[serde(rename = "number")]
36    pub number: i32,
37    /// State of the issue; either 'open' or 'closed'
38    #[serde(rename = "state")]
39    pub state: String,
40    /// The reason for the current state
41    #[serde(rename = "state_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub state_reason: Option<Option<StateReason>>,
43    /// Title of the issue
44    #[serde(rename = "title")]
45    pub title: String,
46    /// Contents of the issue
47    #[serde(rename = "body", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub body: Option<Option<String>>,
49    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
50    pub user: Option<Box<models::NullableSimpleUser>>,
51    /// Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository
52    #[serde(rename = "labels")]
53    pub labels: Vec<models::IssueLabelsInner>,
54    #[serde(rename = "assignee", deserialize_with = "Option::deserialize")]
55    pub assignee: Option<Box<models::NullableSimpleUser>>,
56    #[serde(rename = "assignees", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
57    pub assignees: Option<Option<Vec<models::SimpleUser>>>,
58    #[serde(rename = "milestone", deserialize_with = "Option::deserialize")]
59    pub milestone: Option<Box<models::NullableMilestone>>,
60    #[serde(rename = "locked")]
61    pub locked: bool,
62    #[serde(rename = "active_lock_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
63    pub active_lock_reason: Option<Option<String>>,
64    #[serde(rename = "comments")]
65    pub comments: i32,
66    #[serde(rename = "pull_request", skip_serializing_if = "Option::is_none")]
67    pub pull_request: Option<Box<models::IssuePullRequest>>,
68    #[serde(rename = "closed_at", deserialize_with = "Option::deserialize")]
69    pub closed_at: Option<String>,
70    #[serde(rename = "created_at")]
71    pub created_at: String,
72    #[serde(rename = "updated_at")]
73    pub updated_at: String,
74    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
75    pub draft: Option<bool>,
76    #[serde(rename = "closed_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
77    pub closed_by: Option<Option<Box<models::NullableSimpleUser>>>,
78    #[serde(rename = "body_html", skip_serializing_if = "Option::is_none")]
79    pub body_html: Option<String>,
80    #[serde(rename = "body_text", skip_serializing_if = "Option::is_none")]
81    pub body_text: Option<String>,
82    #[serde(rename = "timeline_url", skip_serializing_if = "Option::is_none")]
83    pub timeline_url: Option<String>,
84    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
85    pub repository: Option<Box<models::Repository>>,
86    #[serde(rename = "performed_via_github_app", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
87    pub performed_via_github_app: Option<Option<Box<models::NullableIntegration>>>,
88    #[serde(rename = "author_association")]
89    pub author_association: models::AuthorAssociation,
90    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
91    pub reactions: Option<Box<models::ReactionRollup>>,
92}
93
94impl NullableIssue {
95    /// Issues are a great way to keep track of tasks, enhancements, and bugs for your projects.
96    pub fn new(id: i64, node_id: String, url: String, repository_url: String, labels_url: String, comments_url: String, events_url: String, html_url: String, number: i32, state: String, title: String, user: Option<models::NullableSimpleUser>, labels: Vec<models::IssueLabelsInner>, assignee: Option<models::NullableSimpleUser>, milestone: Option<models::NullableMilestone>, locked: bool, comments: i32, closed_at: Option<String>, created_at: String, updated_at: String, author_association: models::AuthorAssociation) -> NullableIssue {
97        NullableIssue {
98            id,
99            node_id,
100            url,
101            repository_url,
102            labels_url,
103            comments_url,
104            events_url,
105            html_url,
106            number,
107            state,
108            state_reason: None,
109            title,
110            body: None,
111            user: user.map(Box::new),
112            labels,
113            assignee: assignee.map(Box::new),
114            assignees: None,
115            milestone: milestone.map(Box::new),
116            locked,
117            active_lock_reason: None,
118            comments,
119            pull_request: None,
120            closed_at,
121            created_at,
122            updated_at,
123            draft: None,
124            closed_by: None,
125            body_html: None,
126            body_text: None,
127            timeline_url: None,
128            repository: None,
129            performed_via_github_app: None,
130            author_association,
131            reactions: None,
132        }
133    }
134}
135/// The reason for the current state
136#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
137pub enum StateReason {
138    #[serde(rename = "completed")]
139    Completed,
140    #[serde(rename = "reopened")]
141    Reopened,
142    #[serde(rename = "not_planned")]
143    NotPlanned,
144}
145
146impl Default for StateReason {
147    fn default() -> StateReason {
148        Self::Completed
149    }
150}
151