From 2745eb85b12ea7758e79e89e3f599dd28816ccf8 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 23 Feb 2018 19:14:38 -0500 Subject: [PATCH] Fix the PullRequestEvents --- ofborg/src/ghevent/mod.rs | 2 +- ofborg/src/ghevent/pullrequestevent.rs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ofborg/src/ghevent/mod.rs b/ofborg/src/ghevent/mod.rs index 622fda7..d50c400 100644 --- a/ofborg/src/ghevent/mod.rs +++ b/ofborg/src/ghevent/mod.rs @@ -3,5 +3,5 @@ mod issuecomment; mod pullrequestevent; pub use self::issuecomment::IssueComment; -pub use self::pullrequestevent::{PullRequest,PullRequestEvent}; +pub use self::pullrequestevent::{PullRequest, PullRequestEvent, PullRequestAction, PullRequestState}; pub use self::common::{Issue, Repository, User, Comment}; diff --git a/ofborg/src/ghevent/pullrequestevent.rs b/ofborg/src/ghevent/pullrequestevent.rs index a78a242..1530405 100644 --- a/ofborg/src/ghevent/pullrequestevent.rs +++ b/ofborg/src/ghevent/pullrequestevent.rs @@ -8,7 +8,14 @@ pub struct PullRequestEvent { pub pull_request: PullRequest, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[serde(rename_all="snake_case")] +pub enum PullRequestState { + Open, + Closed, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq)] #[serde(rename_all="snake_case")] pub enum PullRequestAction { Assigned, @@ -21,6 +28,7 @@ pub enum PullRequestAction { Edited, Closed, Reopened, + Synchronize, } #[derive(Serialize, Deserialize, Debug)] @@ -32,9 +40,9 @@ pub struct PullRequestRef { #[derive(Serialize, Deserialize, Debug)] pub struct PullRequest { + pub state: PullRequestState, pub base: PullRequestRef, pub head: PullRequestRef, - pub patch_url: String, }