openapi_github/models/
webhook_issues_closed_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/// WebhookIssuesClosedIssue : The [issue](https://docs.github.com/rest/issues/issues#get-an-issue) itself.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookIssuesClosedIssue {
17    #[serde(rename = "active_lock_reason", deserialize_with = "Option::deserialize")]
18    pub active_lock_reason: Option<String>,
19    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub assignee: Option<Option<serde_json::Value>>,
21    #[serde(rename = "assignees")]
22    pub assignees: Vec<serde_json::Value>,
23    #[serde(rename = "author_association")]
24    pub author_association: String,
25    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
26    pub body: Option<String>,
27    #[serde(rename = "closed_at", deserialize_with = "Option::deserialize")]
28    pub closed_at: Option<String>,
29    #[serde(rename = "comments")]
30    pub comments: i32,
31    #[serde(rename = "comments_url")]
32    pub comments_url: String,
33    #[serde(rename = "created_at")]
34    pub created_at: String,
35    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
36    pub draft: Option<bool>,
37    #[serde(rename = "events_url")]
38    pub events_url: String,
39    #[serde(rename = "html_url")]
40    pub html_url: String,
41    #[serde(rename = "id")]
42    pub id: i32,
43    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
44    pub labels: Option<Vec<serde_json::Value>>,
45    #[serde(rename = "labels_url")]
46    pub labels_url: String,
47    #[serde(rename = "locked", skip_serializing_if = "Option::is_none")]
48    pub locked: Option<bool>,
49    #[serde(rename = "milestone", deserialize_with = "Option::deserialize")]
50    pub milestone: Option<serde_json::Value>,
51    #[serde(rename = "node_id")]
52    pub node_id: String,
53    #[serde(rename = "number")]
54    pub number: i32,
55    #[serde(rename = "performed_via_github_app", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
56    pub performed_via_github_app: Option<Option<serde_json::Value>>,
57    #[serde(rename = "pull_request", skip_serializing_if = "Option::is_none")]
58    pub pull_request: Option<Box<models::WebhooksIssuePullRequest>>,
59    #[serde(rename = "reactions")]
60    pub reactions: Box<models::WebhookIssueCommentCreatedIssueAllOfReactions>,
61    #[serde(rename = "repository_url")]
62    pub repository_url: String,
63    #[serde(rename = "state")]
64    pub state: State,
65    #[serde(rename = "state_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
66    pub state_reason: Option<Option<String>>,
67    #[serde(rename = "timeline_url", skip_serializing_if = "Option::is_none")]
68    pub timeline_url: Option<String>,
69    #[serde(rename = "title")]
70    pub title: String,
71    #[serde(rename = "updated_at")]
72    pub updated_at: String,
73    #[serde(rename = "url")]
74    pub url: String,
75    #[serde(rename = "user")]
76    pub user: Box<models::WebhooksSponsorshipMaintainer>,
77}
78
79impl WebhookIssuesClosedIssue {
80    /// The [issue](https://docs.github.com/rest/issues/issues#get-an-issue) itself.
81    pub fn new(active_lock_reason: Option<String>, assignees: Vec<serde_json::Value>, author_association: String, body: Option<String>, closed_at: Option<String>, comments: i32, comments_url: String, created_at: String, events_url: String, html_url: String, id: i32, labels_url: String, milestone: Option<serde_json::Value>, node_id: String, number: i32, reactions: models::WebhookIssueCommentCreatedIssueAllOfReactions, repository_url: String, state: State, title: String, updated_at: String, url: String, user: models::WebhooksSponsorshipMaintainer) -> WebhookIssuesClosedIssue {
82        WebhookIssuesClosedIssue {
83            active_lock_reason,
84            assignee: None,
85            assignees,
86            author_association,
87            body,
88            closed_at,
89            comments,
90            comments_url,
91            created_at,
92            draft: None,
93            events_url,
94            html_url,
95            id,
96            labels: None,
97            labels_url,
98            locked: None,
99            milestone,
100            node_id,
101            number,
102            performed_via_github_app: None,
103            pull_request: None,
104            reactions: Box::new(reactions),
105            repository_url,
106            state,
107            state_reason: None,
108            timeline_url: None,
109            title,
110            updated_at,
111            url,
112            user: Box::new(user),
113        }
114    }
115}
116/// 
117#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
118pub enum State {
119    #[serde(rename = "closed")]
120    Closed,
121    #[serde(rename = "open")]
122    Open,
123}
124
125impl Default for State {
126    fn default() -> State {
127        Self::Closed
128    }
129}
130