Fix the PullRequestEvents

This commit is contained in:
Graham Christensen 2018-02-23 19:14:38 -05:00
parent c9f3cf368a
commit 2745eb85b1
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 11 additions and 3 deletions

View file

@ -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};

View file

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