1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookIssueCommentEditedIssue {
17 #[serde(rename = "active_lock_reason", deserialize_with = "Option::deserialize")]
18 pub active_lock_reason: Option<String>,
19 #[serde(rename = "assignee", deserialize_with = "Option::deserialize")]
20 pub assignee: Option<Box<models::User1>>,
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")]
44 pub labels: Vec<models::Label>,
45 #[serde(rename = "labels_url")]
46 pub labels_url: String,
47 #[serde(rename = "locked")]
48 pub locked: 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")]
65 pub state: State,
66 #[serde(rename = "state_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
67 pub state_reason: Option<Option<String>>,
68 #[serde(rename = "timeline_url", skip_serializing_if = "Option::is_none")]
69 pub timeline_url: Option<String>,
70 #[serde(rename = "title")]
71 pub title: String,
72 #[serde(rename = "updated_at")]
73 pub updated_at: String,
74 #[serde(rename = "url")]
75 pub url: String,
76 #[serde(rename = "user")]
77 pub user: Box<models::WebhooksSponsorshipMaintainer>,
78}
79
80impl WebhookIssueCommentEditedIssue {
81 pub fn new(active_lock_reason: Option<String>, assignee: Option<models::User1>, 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: Vec<models::Label>, labels_url: String, locked: bool, 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) -> WebhookIssueCommentEditedIssue {
83 WebhookIssueCommentEditedIssue {
84 active_lock_reason,
85 assignee: assignee.map(Box::new),
86 assignees,
87 author_association,
88 body,
89 closed_at,
90 comments,
91 comments_url,
92 created_at,
93 draft: None,
94 events_url,
95 html_url,
96 id,
97 labels,
98 labels_url,
99 locked,
100 milestone,
101 node_id,
102 number,
103 performed_via_github_app: None,
104 pull_request: None,
105 reactions: Box::new(reactions),
106 repository_url,
107 state,
108 state_reason: None,
109 timeline_url: None,
110 title,
111 updated_at,
112 url,
113 user: Box::new(user),
114 }
115 }
116}
117#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
119pub enum State {
120 #[serde(rename = "open")]
121 Open,
122 #[serde(rename = "closed")]
123 Closed,
124}
125
126impl Default for State {
127 fn default() -> State {
128 Self::Open
129 }
130}
131