openapi_github/models/
webhook_commit_comment_created_comment.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookCommitCommentCreatedComment {
17 #[serde(rename = "author_association")]
19 pub author_association: AuthorAssociation,
20 #[serde(rename = "body")]
22 pub body: String,
23 #[serde(rename = "commit_id")]
25 pub commit_id: String,
26 #[serde(rename = "created_at")]
27 pub created_at: String,
28 #[serde(rename = "html_url")]
29 pub html_url: String,
30 #[serde(rename = "id")]
32 pub id: i32,
33 #[serde(rename = "line", deserialize_with = "Option::deserialize")]
35 pub line: Option<i32>,
36 #[serde(rename = "node_id")]
38 pub node_id: String,
39 #[serde(rename = "path", deserialize_with = "Option::deserialize")]
41 pub path: Option<String>,
42 #[serde(rename = "position", deserialize_with = "Option::deserialize")]
44 pub position: Option<i32>,
45 #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
46 pub reactions: Option<Box<models::Reactions>>,
47 #[serde(rename = "updated_at")]
48 pub updated_at: String,
49 #[serde(rename = "url")]
50 pub url: String,
51 #[serde(rename = "user", deserialize_with = "Option::deserialize")]
52 pub user: Option<Box<models::User>>,
53}
54
55impl WebhookCommitCommentCreatedComment {
56 pub fn new(author_association: AuthorAssociation, body: String, commit_id: String, created_at: String, html_url: String, id: i32, line: Option<i32>, node_id: String, path: Option<String>, position: Option<i32>, updated_at: String, url: String, user: Option<models::User>) -> WebhookCommitCommentCreatedComment {
58 WebhookCommitCommentCreatedComment {
59 author_association,
60 body,
61 commit_id,
62 created_at,
63 html_url,
64 id,
65 line,
66 node_id,
67 path,
68 position,
69 reactions: None,
70 updated_at,
71 url,
72 user: user.map(Box::new),
73 }
74 }
75}
76#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum AuthorAssociation {
79 #[serde(rename = "COLLABORATOR")]
80 Collaborator,
81 #[serde(rename = "CONTRIBUTOR")]
82 Contributor,
83 #[serde(rename = "FIRST_TIMER")]
84 FirstTimer,
85 #[serde(rename = "FIRST_TIME_CONTRIBUTOR")]
86 FirstTimeContributor,
87 #[serde(rename = "MANNEQUIN")]
88 Mannequin,
89 #[serde(rename = "MEMBER")]
90 Member,
91 #[serde(rename = "NONE")]
92 None,
93 #[serde(rename = "OWNER")]
94 Owner,
95}
96
97impl Default for AuthorAssociation {
98 fn default() -> AuthorAssociation {
99 Self::Collaborator
100 }
101}
102