-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #979 from seregamorph/feature/pull_request-edited
pull_request action "edited": changes
- Loading branch information
Showing
5 changed files
with
1,110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
src/main/java/org/kohsuke/github/GHPullRequestChanges.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package org.kohsuke.github; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
|
||
/** | ||
* Wrapper to define changed fields on pull_request action="edited" | ||
* | ||
* @see GHEventPayload.PullRequest | ||
*/ | ||
@SuppressFBWarnings("UWF_UNWRITTEN_FIELD") | ||
public class GHPullRequestChanges { | ||
|
||
private GHCommitPointer base; | ||
private GHFrom title; | ||
private GHFrom body; | ||
|
||
/** | ||
* Old target branch for pull request. | ||
* | ||
* @return old target branch info (or null if not changed) | ||
*/ | ||
public GHCommitPointer getBase() { | ||
return base; | ||
} | ||
|
||
/** | ||
* Old pull request title. | ||
* | ||
* @return old pull request title (or null if not changed) | ||
*/ | ||
public GHFrom getTitle() { | ||
return title; | ||
} | ||
|
||
/** | ||
* Old pull request body. | ||
* | ||
* @return old pull request body (or null if not changed) | ||
*/ | ||
public GHFrom getBody() { | ||
return body; | ||
} | ||
|
||
/** | ||
* @see org.kohsuke.github.GHCommitPointer | ||
*/ | ||
public static class GHCommitPointer { | ||
private GHFrom ref; | ||
private GHFrom sha; | ||
|
||
/** | ||
* Named ref to the commit. This (from value) appears to be a "short ref" that doesn't include "refs/heads/" | ||
* portion. | ||
* | ||
* @return the ref | ||
*/ | ||
public GHFrom getRef() { | ||
return ref; | ||
} | ||
|
||
/** | ||
* SHA1 of the commit. | ||
* | ||
* @return sha | ||
*/ | ||
public GHFrom getSha() { | ||
return sha; | ||
} | ||
} | ||
|
||
/** | ||
* Wrapper for changed values. | ||
*/ | ||
public static class GHFrom { | ||
private String from; | ||
|
||
/** | ||
* Previous value that was changed. | ||
* | ||
* @return previous value | ||
*/ | ||
public String getFrom() { | ||
return from; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.