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