openapi_github/models/
webhook_commit_comment_created.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookCommitCommentCreated {
16 #[serde(rename = "action")]
18 pub action: Action,
19 #[serde(rename = "comment")]
20 pub comment: Box<models::WebhookCommitCommentCreatedComment>,
21 #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
22 pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
23 #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
24 pub installation: Option<Box<models::SimpleInstallation>>,
25 #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
26 pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
27 #[serde(rename = "repository")]
28 pub repository: Box<models::RepositoryWebhooks>,
29 #[serde(rename = "sender")]
30 pub sender: Box<models::SimpleUserWebhooks>,
31}
32
33impl WebhookCommitCommentCreated {
34 pub fn new(action: Action, comment: models::WebhookCommitCommentCreatedComment, repository: models::RepositoryWebhooks, sender: models::SimpleUserWebhooks) -> WebhookCommitCommentCreated {
35 WebhookCommitCommentCreated {
36 action,
37 comment: Box::new(comment),
38 enterprise: None,
39 installation: None,
40 organization: None,
41 repository: Box::new(repository),
42 sender: Box::new(sender),
43 }
44 }
45}
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Action {
49 #[serde(rename = "created")]
50 Created,
51}
52
53impl Default for Action {
54 fn default() -> Action {
55 Self::Created
56 }
57}
58