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, }