listStatuses() {
.toIterable(GHDeploymentStatus[].class, item -> item.lateBind(owner));
}
+ /**
+ * Gets the owner.
+ *
+ * @return the owner
+ */
// test only
GHRepository getOwner() {
return owner;
diff --git a/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java b/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java
index 0a390f2b92..84b333d65e 100644
--- a/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHDeploymentBuilder.java
@@ -6,6 +6,7 @@
import java.io.IOException;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* The type GHDeploymentBuilder.
*/
@@ -125,12 +126,10 @@ public GHDeploymentBuilder environment(String environment) {
* Specifies if the given environment is specific to the deployment and will no longer exist at some point in the
* future.
*
- * @deprecated until preview feature has graduated to stable
- *
* @param transientEnvironment
* the environment is transient
- *
* @return the gh deployment builder
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.ANT_MAN)
public GHDeploymentBuilder transientEnvironment(boolean transientEnvironment) {
@@ -141,12 +140,10 @@ public GHDeploymentBuilder transientEnvironment(boolean transientEnvironment) {
/**
* Specifies if the given environment is one that end-users directly interact with.
*
- * @deprecated until preview feature has graduated to stable
- *
* @param productionEnvironment
* the environment is used by end-users directly
- *
* @return the gh deployment builder
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.ANT_MAN)
public GHDeploymentBuilder productionEnvironment(boolean productionEnvironment) {
diff --git a/src/main/java/org/kohsuke/github/GHDeploymentState.java b/src/main/java/org/kohsuke/github/GHDeploymentState.java
index 842ec39239..628979aa7d 100644
--- a/src/main/java/org/kohsuke/github/GHDeploymentState.java
+++ b/src/main/java/org/kohsuke/github/GHDeploymentState.java
@@ -2,13 +2,22 @@
import org.kohsuke.github.internal.Previews;
+// TODO: Auto-generated Javadoc
/**
- * Represents the state of deployment
+ * Represents the state of deployment.
*/
public enum GHDeploymentState {
+
+ /** The pending. */
PENDING,
+
+ /** The success. */
SUCCESS,
+
+ /** The error. */
ERROR,
+
+ /** The failure. */
FAILURE,
/**
diff --git a/src/main/java/org/kohsuke/github/GHDeploymentStatus.java b/src/main/java/org/kohsuke/github/GHDeploymentStatus.java
index 7f0edaba9c..208b5e92cf 100644
--- a/src/main/java/org/kohsuke/github/GHDeploymentStatus.java
+++ b/src/main/java/org/kohsuke/github/GHDeploymentStatus.java
@@ -5,18 +5,35 @@
import java.net.URL;
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* The type GHDeploymentStatus.
*/
public class GHDeploymentStatus extends GHObject {
private GHRepository owner;
+
+ /** The creator. */
protected GHUser creator;
+
+ /** The state. */
protected String state;
+
+ /** The description. */
protected String description;
+
+ /** The target url. */
protected String target_url;
+
+ /** The log url. */
protected String log_url;
+
+ /** The deployment url. */
protected String deployment_url;
+
+ /** The repository url. */
protected String repository_url;
+
+ /** The environment url. */
protected String environment_url;
/**
@@ -48,9 +65,8 @@ GHDeploymentStatus lateBind(GHRepository owner) {
/**
* Gets target url.
*
- * @deprecated Target url is deprecated in favor of {@link #getLogUrl() getLogUrl}
- *
* @return the target url
+ * @deprecated Target url is deprecated in favor of {@link #getLogUrl() getLogUrl}
*/
@Deprecated
public URL getTargetUrl() {
@@ -62,9 +78,8 @@ public URL getTargetUrl() {
*
* This method replaces {@link #getTargetUrl() getTargetUrl}}.
*
- * @deprecated until preview feature has graduated to stable
- *
* @return the target url
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.ANT_MAN)
public URL getLogUrl() {
@@ -83,9 +98,8 @@ public URL getDeploymentUrl() {
/**
* Gets deployment environment url.
*
- * @deprecated until preview feature has graduated to stable
- *
* @return the deployment environment url
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.ANT_MAN)
public URL getEnvironmentUrl() {
@@ -111,6 +125,9 @@ public GHDeploymentState getState() {
}
/**
+ * Gets the html url.
+ *
+ * @return the html url
* @deprecated This object has no HTML URL.
*/
@Override
@@ -118,6 +135,11 @@ public URL getHtmlUrl() {
return null;
}
+ /**
+ * Gets the owner.
+ *
+ * @return the owner
+ */
// test only
GHRepository getOwner() {
return owner;
diff --git a/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java b/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java
index ff90f5c380..8cfc9ad5eb 100644
--- a/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHDeploymentStatusBuilder.java
@@ -4,6 +4,7 @@
import java.io.IOException;
+// TODO: Auto-generated Javadoc
/**
* Creates a new deployment status.
*
@@ -31,6 +32,16 @@ public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeployme
this(repo, (long) deploymentId, state);
}
+ /**
+ * Instantiates a new GH deployment status builder.
+ *
+ * @param repo
+ * the repo
+ * @param deploymentId
+ * the deployment id
+ * @param state
+ * the state
+ */
GHDeploymentStatusBuilder(GHRepository repo, long deploymentId, GHDeploymentState state) {
this.repo = repo;
this.deploymentId = deploymentId;
@@ -47,12 +58,10 @@ public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeployme
* Add an inactive status to all prior non-transient, non-production environment deployments with the same
* repository and environment name as the created status's deployment.
*
- * @deprecated until preview feature has graduated to stable
- *
* @param autoInactive
* Add inactive status flag
- *
* @return the gh deployment status builder
+ * @deprecated until preview feature has graduated to stable
*/
@Preview({ Previews.ANT_MAN, Previews.FLASH })
public GHDeploymentStatusBuilder autoInactive(boolean autoInactive) {
@@ -76,12 +85,10 @@ public GHDeploymentStatusBuilder description(String description) {
/**
* Name for the target deployment environment, which can be changed when setting a deploy status.
*
- * @deprecated until preview feature has graduated to stable
- *
* @param environment
* the environment name
- *
* @return the gh deployment status builder
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.FLASH)
public GHDeploymentStatusBuilder environment(String environment) {
@@ -90,14 +97,12 @@ public GHDeploymentStatusBuilder environment(String environment) {
}
/**
- * The URL for accessing the environment
- *
- * @deprecated until preview feature has graduated to stable
+ * The URL for accessing the environment.
*
* @param environmentUrl
* the environment url
- *
* @return the gh deployment status builder
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.ANT_MAN)
public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) {
@@ -110,12 +115,10 @@ public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) {
*
* This method replaces {@link #targetUrl(String) targetUrl}.
*
- * @deprecated until preview feature has graduated to stable
- *
* @param logUrl
* the deployment output url
- *
* @return the gh deployment status builder
+ * @deprecated until preview feature has graduated to stable
*/
@Preview(Previews.ANT_MAN)
public GHDeploymentStatusBuilder logUrl(String logUrl) {
@@ -126,12 +129,10 @@ public GHDeploymentStatusBuilder logUrl(String logUrl) {
/**
* Target url gh deployment status builder.
*
- * @deprecated Target url is deprecated in favor of {@link #logUrl(String) logUrl}
- *
* @param targetUrl
* the target url
- *
* @return the gh deployment status builder
+ * @deprecated Target url is deprecated in favor of {@link #logUrl(String) logUrl}
*/
@Deprecated
public GHDeploymentStatusBuilder targetUrl(String targetUrl) {
diff --git a/src/main/java/org/kohsuke/github/GHDirection.java b/src/main/java/org/kohsuke/github/GHDirection.java
index 0db172dccf..e91768d969 100644
--- a/src/main/java/org/kohsuke/github/GHDirection.java
+++ b/src/main/java/org/kohsuke/github/GHDirection.java
@@ -1,10 +1,15 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
- * Sort direction
+ * Sort direction.
*
* @author Kohsuke Kawaguchi
*/
public enum GHDirection {
- ASC, DESC
+
+ /** The asc. */
+ ASC,
+ /** The desc. */
+ DESC
}
diff --git a/src/main/java/org/kohsuke/github/GHDiscussion.java b/src/main/java/org/kohsuke/github/GHDiscussion.java
index 27b7910422..3308736166 100644
--- a/src/main/java/org/kohsuke/github/GHDiscussion.java
+++ b/src/main/java/org/kohsuke/github/GHDiscussion.java
@@ -11,6 +11,7 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* A discussion in GitHub Team.
*
@@ -26,11 +27,25 @@ public class GHDiscussion extends GHObject {
@JsonProperty(value = "private")
private boolean isPrivate;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
return GitHubClient.parseURL(htmlUrl);
}
+ /**
+ * Wrap up.
+ *
+ * @param team
+ * the team
+ * @return the GH discussion
+ */
GHDiscussion wrapUp(GHTeam team) {
this.team = team;
return this;
@@ -110,6 +125,17 @@ static GHDiscussion.Creator create(GHTeam team) throws IOException {
return new GHDiscussion.Creator(team);
}
+ /**
+ * Read.
+ *
+ * @param team
+ * the team
+ * @param discussionNumber
+ * the discussion number
+ * @return the GH discussion
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
static GHDiscussion read(GHTeam team, long discussionNumber) throws IOException {
return team.root()
.createRequest()
@@ -118,6 +144,15 @@ static GHDiscussion read(GHTeam team, long discussionNumber) throws IOException
.wrapUp(team);
}
+ /**
+ * Read all.
+ *
+ * @param team
+ * the team
+ * @return the paged iterable
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
static PagedIterable readAll(GHTeam team) throws IOException {
return team.root()
.createRequest()
@@ -148,7 +183,7 @@ public GHDiscussion.Setter set() {
}
/**
- * Delete the discussion
+ * Delete the discussion.
*
* @throws IOException
* the io exception
@@ -212,6 +247,13 @@ public Creator private_(boolean value) throws IOException {
}
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -225,6 +267,11 @@ public boolean equals(Object o) {
&& Objects.equals(body, that.body) && Objects.equals(title, that.title);
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return Objects.hash(team, number, body, title);
diff --git a/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java b/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java
index a438ae1c3c..19097c09fc 100644
--- a/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHDiscussionBuilder.java
@@ -5,6 +5,7 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* Base class for creating or updating a discussion.
*
@@ -18,6 +19,7 @@ class GHDiscussionBuilder extends AbstractBuilder {
private final GHTeam team;
/**
+ * Instantiates a new GH discussion builder.
*
* @param intermediateReturnType
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If
diff --git a/src/main/java/org/kohsuke/github/GHEmail.java b/src/main/java/org/kohsuke/github/GHEmail.java
index e1b892f007..270f09baf1 100644
--- a/src/main/java/org/kohsuke/github/GHEmail.java
+++ b/src/main/java/org/kohsuke/github/GHEmail.java
@@ -25,6 +25,7 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
* Represents an email of GitHub.
*
@@ -36,8 +37,13 @@
justification = "JSON API")
public class GHEmail {
+ /** The email. */
protected String email;
+
+ /** The primary. */
protected boolean primary;
+
+ /** The verified. */
protected boolean verified;
/**
@@ -67,16 +73,33 @@ public boolean isVerified() {
return verified;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return "Email:" + email;
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return email.hashCode();
}
+ /**
+ * Equals.
+ *
+ * @param obj
+ * the obj
+ * @return true, if successful
+ */
@Override
public boolean equals(Object obj) {
if (obj instanceof GHEmail) {
diff --git a/src/main/java/org/kohsuke/github/GHEvent.java b/src/main/java/org/kohsuke/github/GHEvent.java
index 2d71ee1e52..d93411bedf 100644
--- a/src/main/java/org/kohsuke/github/GHEvent.java
+++ b/src/main/java/org/kohsuke/github/GHEvent.java
@@ -2,6 +2,7 @@
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* Hook event type.
*
@@ -10,67 +11,191 @@
* @see Event type reference
*/
public enum GHEvent {
+
+ /** The branch protection rule. */
BRANCH_PROTECTION_RULE,
+
+ /** The check run. */
CHECK_RUN,
+
+ /** The check suite. */
CHECK_SUITE,
+
+ /** The code scanning alert. */
CODE_SCANNING_ALERT,
+
+ /** The commit comment. */
COMMIT_COMMENT,
+
+ /** The content reference. */
CONTENT_REFERENCE,
+
+ /** The create. */
CREATE,
+
+ /** The delete. */
DELETE,
+
+ /** The deploy key. */
DEPLOY_KEY,
+
+ /** The deployment. */
DEPLOYMENT,
+
+ /** The deployment status. */
DEPLOYMENT_STATUS,
+
+ /** The discussion. */
DISCUSSION,
+
+ /** The discussion comment. */
DISCUSSION_COMMENT,
+
+ /** The download. */
DOWNLOAD,
+
+ /** The follow. */
FOLLOW,
+
+ /** The fork. */
FORK,
+
+ /** The fork apply. */
FORK_APPLY,
+
+ /** The github app authorization. */
GITHUB_APP_AUTHORIZATION,
+
+ /** The gist. */
GIST,
+
+ /** The gollum. */
GOLLUM,
+
+ /** The installation. */
INSTALLATION,
+
+ /** The installation repositories. */
INSTALLATION_REPOSITORIES,
+
+ /** The integration installation repositories. */
INTEGRATION_INSTALLATION_REPOSITORIES,
+
+ /** The issue comment. */
ISSUE_COMMENT,
+
+ /** The issues. */
ISSUES,
+
+ /** The label. */
LABEL,
+
+ /** The marketplace purchase. */
MARKETPLACE_PURCHASE,
+
+ /** The member. */
MEMBER,
+
+ /** The membership. */
MEMBERSHIP,
+
+ /** The merge queue entry. */
MERGE_QUEUE_ENTRY,
+
+ /** The meta. */
META,
+
+ /** The milestone. */
MILESTONE,
+
+ /** The organization. */
ORGANIZATION,
+
+ /** The org block. */
ORG_BLOCK,
+
+ /** The package. */
PACKAGE,
+
+ /** The page build. */
PAGE_BUILD,
+
+ /** The project card. */
PROJECT_CARD,
+
+ /** The project column. */
PROJECT_COLUMN,
+
+ /** The project. */
PROJECT,
+
+ /** The ping. */
PING,
+
+ /** The public. */
PUBLIC,
+
+ /** The pull request. */
PULL_REQUEST,
+
+ /** The pull request review. */
PULL_REQUEST_REVIEW,
+
+ /** The pull request review comment. */
PULL_REQUEST_REVIEW_COMMENT,
+
+ /** The pull request review thread. */
PULL_REQUEST_REVIEW_THREAD,
+
+ /** The push. */
PUSH,
+
+ /** The registry package. */
REGISTRY_PACKAGE,
+
+ /** The release. */
RELEASE,
- REPOSITORY_DISPATCH, // only valid for org hooks
+
+ /** The repository dispatch. */
+ REPOSITORY_DISPATCH,
+ /** The repository. */
+ // only valid for org hooks
REPOSITORY,
+
+ /** The repository import. */
REPOSITORY_IMPORT,
+
+ /** The repository vulnerability alert. */
REPOSITORY_VULNERABILITY_ALERT,
+
+ /** The schedule. */
SCHEDULE,
+
+ /** The security advisory. */
SECURITY_ADVISORY,
+
+ /** The star. */
STAR,
+
+ /** The status. */
STATUS,
+
+ /** The team. */
TEAM,
+
+ /** The team add. */
TEAM_ADD,
+
+ /** The watch. */
WATCH,
+
+ /** The workflow job. */
WORKFLOW_JOB,
+
+ /** The workflow dispatch. */
WORKFLOW_DISPATCH,
+
+ /** The workflow run. */
WORKFLOW_RUN,
/**
@@ -78,13 +203,13 @@ public enum GHEvent {
*/
UNKNOWN,
- /**
- * Special event type that means "every possible event"
- */
+ /** Special event type that means "every possible event". */
ALL;
/**
* Returns GitHub's internal representation of this event.
+ *
+ * @return the string
*/
String symbol() {
if (this == ALL)
diff --git a/src/main/java/org/kohsuke/github/GHEventInfo.java b/src/main/java/org/kohsuke/github/GHEventInfo.java
index cd194faace..a781cb5668 100644
--- a/src/main/java/org/kohsuke/github/GHEventInfo.java
+++ b/src/main/java/org/kohsuke/github/GHEventInfo.java
@@ -6,6 +6,7 @@
import java.io.IOException;
import java.util.*;
+// TODO: Auto-generated Javadoc
/**
* Represents an event.
*
@@ -50,6 +51,7 @@ public static class GHEventRepository {
private String name; // owner/repo
}
+ /** The Constant mapTypeStringToEvent. */
static final Map mapTypeStringToEvent = createEventMap();
/**
@@ -78,6 +80,13 @@ private static Map createEventMap() {
return Collections.unmodifiableMap(map);
}
+ /**
+ * Transform type to GH event.
+ *
+ * @param type
+ * the type
+ * @return the GH event
+ */
static GHEvent transformTypeToGHEvent(String type) {
return mapTypeStringToEvent.getOrDefault(type, GHEvent.UNKNOWN);
}
diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java
index e7af6e93d1..b6549faadd 100644
--- a/src/main/java/org/kohsuke/github/GHEventPayload.java
+++ b/src/main/java/org/kohsuke/github/GHEventPayload.java
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;
+// TODO: Auto-generated Javadoc
/**
* Base type for types used in databinding of the event payload.
*
@@ -28,6 +29,9 @@ public abstract class GHEventPayload extends GitHubInteractiveObject {
private GHOrganization organization;
private GHAppInstallation installation;
+ /**
+ * Instantiates a new GH event payload.
+ */
GHEventPayload() {
}
@@ -108,7 +112,7 @@ public void setOrganization(GHOrganization organization) {
}
/**
- * Gets installation
+ * Gets installation.
*
* @return the installation
*/
@@ -125,6 +129,9 @@ public GHAppInstallation getInstallation() {
// ProjectCardEvent ProjectColumnEvent ProjectEvent RepositoryDispatchEvent RepositoryImportEvent
// RepositoryVulnerabilityAlertEvent SecurityAdvisoryEvent StarEvent StatusEvent TeamEvent TeamAddEvent WatchEvent
+ /**
+ * Late bind.
+ */
void lateBind() {
}
@@ -150,7 +157,7 @@ public int getNumber() {
}
/**
- * Sets Check Run object
+ * Sets Check Run object.
*
* @param currentCheckRun
* the check run object
@@ -162,7 +169,7 @@ public void setCheckRun(GHCheckRun currentCheckRun) {
}
/**
- * Gets Check Run object
+ * Gets Check Run object.
*
* @return the current checkRun object
*/
@@ -172,7 +179,7 @@ public GHCheckRun getCheckRun() {
}
/**
- * Sets the Requested Action object
+ * Sets the Requested Action object.
*
* @param currentRequestedAction
* the current action
@@ -184,7 +191,7 @@ public void setRequestedAction(GHRequestedAction currentRequestedAction) {
}
/**
- * Gets the Requested Action object
+ * Gets the Requested Action object.
*
* @return the requested action
*/
@@ -193,6 +200,9 @@ public GHRequestedAction getRequestedAction() {
return requestedAction;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (checkRun == null)
@@ -219,7 +229,7 @@ public static class CheckSuite extends GHEventPayload {
private GHCheckSuite checkSuite;
/**
- * Gets the Check Suite object
+ * Gets the Check Suite object.
*
* @return the Check Suite object
*/
@@ -228,6 +238,9 @@ public GHCheckSuite getCheckSuite() {
return checkSuite;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (checkSuite == null)
@@ -255,7 +268,7 @@ public static class Installation extends GHEventPayload {
private List repositories;
/**
- * Gets repositories
+ * Gets repositories.
*
* @return the repositories
*/
@@ -263,6 +276,9 @@ public List getRepositories() {
return Collections.unmodifiableList(repositories);
};
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (getInstallation() == null) {
@@ -299,7 +315,7 @@ public static class InstallationRepositories extends GHEventPayload {
private List repositoriesRemoved;
/**
- * Gets installation selection
+ * Gets installation selection.
*
* @return the installation selection
*/
@@ -308,7 +324,7 @@ public String getRepositorySelection() {
}
/**
- * Gets repositories added
+ * Gets repositories added.
*
* @return the repositories
*/
@@ -317,7 +333,7 @@ public List getRepositoriesAdded() {
}
/**
- * Gets repositories removed
+ * Gets repositories removed.
*
* @return the repositories
*/
@@ -325,6 +341,9 @@ public List getRepositoriesRemoved() {
return Collections.unmodifiableList(repositoriesRemoved);
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (getInstallation() == null) {
@@ -395,7 +414,7 @@ public GHLabel getLabel() {
}
/**
- * Get changes (for action="edited")
+ * Get changes (for action="edited").
*
* @return changes
*/
@@ -404,6 +423,9 @@ public GHPullRequestChanges getChanges() {
return changes;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (pullRequest == null)
@@ -418,7 +440,7 @@ void lateBind() {
}
/**
- * A review was added to a pull request
+ * A review was added to a pull request.
*
* @see
@@ -449,6 +471,9 @@ public GHPullRequest getPullRequest() {
return pullRequest;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (review == null)
@@ -466,7 +491,7 @@ void lateBind() {
}
/**
- * Wrapper for changes on issue and pull request review comments action="edited"
+ * Wrapper for changes on issue and pull request review comments action="edited".
*
* @see GHEventPayload.IssueComment
* @see GHEventPayload.PullRequestReviewComment
@@ -503,7 +528,7 @@ public String getFrom() {
}
/**
- * A review comment was added to a pull request
+ * A review comment was added to a pull request.
*
* @see
@@ -526,7 +551,7 @@ public GHPullRequestReviewComment getComment() {
}
/**
- * Get changes (for action="edited")
+ * Get changes (for action="edited").
*
* @return changes
*/
@@ -544,6 +569,9 @@ public GHPullRequest getPullRequest() {
return pullRequest;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (comment == null)
@@ -607,7 +635,7 @@ public GHLabel getLabel() {
}
/**
- * Get changes (for action="edited")
+ * Get changes (for action="edited").
*
* @return changes
*/
@@ -616,6 +644,9 @@ public GHIssueChanges getChanges() {
return changes;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
super.lateBind();
@@ -627,7 +658,7 @@ void lateBind() {
}
/**
- * A comment was added to an issue
+ * A comment was added to an issue.
*
* @see
@@ -650,7 +681,7 @@ public GHIssueComment getComment() {
}
/**
- * Get changes (for action="edited")
+ * Get changes (for action="edited").
*
* @return changes
*/
@@ -692,6 +723,9 @@ public void setIssue(GHIssue issue) {
throw new RuntimeException("Do not use this method.");
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
super.lateBind();
@@ -704,7 +738,7 @@ void lateBind() {
}
/**
- * A comment was added to a commit
+ * A comment was added to a commit.
*
* @see
@@ -736,6 +770,9 @@ public void setComment(GHCommitComment comment) {
throw new RuntimeException("Do not use this method.");
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
super.lateBind();
@@ -747,7 +784,7 @@ void lateBind() {
}
/**
- * A repository, branch, or tag was created
+ * A repository, branch, or tag was created.
*
* @see
* create event
@@ -799,7 +836,7 @@ public String getDescription() {
}
/**
- * A branch, or tag was deleted
+ * A branch, or tag was deleted.
*
* @see
* delete event
@@ -829,7 +866,7 @@ public String getRefType() {
}
/**
- * A deployment
+ * A deployment.
*
* @see
* deployment event
@@ -860,6 +897,9 @@ public void setDeployment(GHDeployment deployment) {
throw new RuntimeException("Do not use this method.");
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
super.lateBind();
@@ -871,7 +911,7 @@ void lateBind() {
}
/**
- * A deployment status
+ * A deployment status.
*
* @see
@@ -926,6 +966,9 @@ public void setDeployment(GHDeployment deployment) {
throw new RuntimeException("Do not use this method.");
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
super.lateBind();
@@ -938,7 +981,7 @@ void lateBind() {
}
/**
- * A user forked a repository
+ * A user forked a repository.
*
* @see fork
* event
@@ -1000,11 +1043,12 @@ public static class Push extends GHEventPayload {
private String ref;
private int size;
private List commits;
+ private PushCommit headCommit;
private Pusher pusher;
private String compare;
/**
- * The SHA of the HEAD commit on the repository
+ * The SHA of the HEAD commit on the repository.
*
* @return the head
*/
@@ -1081,6 +1125,16 @@ public List getCommits() {
return Collections.unmodifiableList(commits);
}
+ /**
+ * The head commit of the push.
+ *
+ * @return the commit
+ */
+ @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
+ public PushCommit getHeadCommit() {
+ return headCommit;
+ }
+
/**
* Gets pusher.
*
@@ -1258,7 +1312,7 @@ public List getModified() {
}
/**
- * Obtains the timestamp of the commit
+ * Obtains the timestamp of the commit.
*
* @return the timestamp
*/
@@ -1269,7 +1323,7 @@ public Date getTimestamp() {
}
/**
- * A release was added to the repo
+ * A release was added to the repo.
*
* @see
* release event
@@ -1398,6 +1452,9 @@ public void setCommit(GHCommit commit) {
throw new RuntimeException("Do not use this method.");
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
@@ -1490,6 +1547,9 @@ public GHWorkflow getWorkflow() {
return workflow;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (workflowRun == null || workflow == null) {
@@ -1528,6 +1588,9 @@ public GHWorkflowJob getWorkflowJob() {
return workflowJob;
}
+ /**
+ * Late bind.
+ */
@Override
void lateBind() {
if (workflowJob == null) {
@@ -1566,7 +1629,7 @@ public GHLabel getLabel() {
}
/**
- * Gets changes (for action="edited")
+ * Gets changes (for action="edited").
*
* @return changes
*/
@@ -1630,4 +1693,36 @@ public Date getStarredAt() {
return GitHubClient.parseDate(starredAt);
}
}
+
+ /**
+ * A project v2 item was archived, converted, created, edited, restored, deleted, or reordered.
+ *
+ * @see star
+ * event
+ */
+ public static class ProjectsV2Item extends GHEventPayload {
+
+ private GHProjectsV2Item projectsV2Item;
+ private GHProjectsV2ItemChanges changes;
+
+ /**
+ * Gets the projects V 2 item.
+ *
+ * @return the projects V 2 item
+ */
+ @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
+ public GHProjectsV2Item getProjectsV2Item() {
+ return projectsV2Item;
+ }
+
+ /**
+ * Gets the changes.
+ *
+ * @return the changes
+ */
+ public GHProjectsV2ItemChanges getChanges() {
+ return changes;
+ }
+ }
}
diff --git a/src/main/java/org/kohsuke/github/GHException.java b/src/main/java/org/kohsuke/github/GHException.java
index 32534d40d6..d843b141ed 100644
--- a/src/main/java/org/kohsuke/github/GHException.java
+++ b/src/main/java/org/kohsuke/github/GHException.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* The type GHException.
*
diff --git a/src/main/java/org/kohsuke/github/GHFileNotFoundException.java b/src/main/java/org/kohsuke/github/GHFileNotFoundException.java
index e2fcd1ad57..4de844e0ae 100644
--- a/src/main/java/org/kohsuke/github/GHFileNotFoundException.java
+++ b/src/main/java/org/kohsuke/github/GHFileNotFoundException.java
@@ -8,12 +8,15 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
- * Request/responce contains useful metadata. Custom exception allows store info for next diagnostics.
+ * Request/response contains useful metadata. Custom exception allows store info for next diagnostics.
*
* @author Kanstantsin Shautsou
*/
public class GHFileNotFoundException extends FileNotFoundException {
+
+ /** The response header fields. */
protected Map> responseHeaderFields;
/**
@@ -55,6 +58,13 @@ public Map> getResponseHeaderFields() {
return Collections.unmodifiableMap(responseHeaderFields);
}
+ /**
+ * With response header fields.
+ *
+ * @param headerFields
+ * the header fields
+ * @return the GH file not found exception
+ */
GHFileNotFoundException withResponseHeaderFields(@Nonnull Map> headerFields) {
this.responseHeaderFields = headerFields;
return this;
diff --git a/src/main/java/org/kohsuke/github/GHFork.java b/src/main/java/org/kohsuke/github/GHFork.java
index 190006392c..34434e137f 100644
--- a/src/main/java/org/kohsuke/github/GHFork.java
+++ b/src/main/java/org/kohsuke/github/GHFork.java
@@ -1,7 +1,8 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
- * The enum for Fork search mode
+ * The enum for Fork search mode.
*/
public enum GHFork {
@@ -27,10 +28,22 @@ public enum GHFork {
PARENT_ONLY("");
private String filterMode;
+
+ /**
+ * Instantiates a new GH fork.
+ *
+ * @param mode
+ * the mode
+ */
GHFork(final String mode) {
this.filterMode = mode;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return filterMode;
diff --git a/src/main/java/org/kohsuke/github/GHGist.java b/src/main/java/org/kohsuke/github/GHGist.java
index 887a2c6d0e..d035ee6ef6 100644
--- a/src/main/java/org/kohsuke/github/GHGist.java
+++ b/src/main/java/org/kohsuke/github/GHGist.java
@@ -11,8 +11,9 @@
import java.util.Map;
import java.util.Map.Entry;
+// TODO: Auto-generated Javadoc
/**
- * Gist
+ * Gist.
*
* @author Kohsuke Kawaguchi
* @see GHUser#listGists() GHUser#listGists()
@@ -22,6 +23,7 @@
*/
public class GHGist extends GHObject {
+ /** The owner. */
final GHUser owner;
private String forks_url, commits_url, id, git_pull_url, git_push_url, html_url;
@@ -183,6 +185,13 @@ public Map getFiles() {
return Collections.unmodifiableMap(files);
}
+ /**
+ * Gets the api tail url.
+ *
+ * @param tail
+ * the tail
+ * @return the api tail url
+ */
String getApiTailUrl(String tail) {
String result = "/gists/" + id;
if (!StringUtils.isBlank(tail)) {
@@ -263,6 +272,13 @@ public GHGistUpdater update() throws IOException {
return new GHGistUpdater(this);
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(Object o) {
if (this == o)
@@ -274,6 +290,11 @@ public boolean equals(Object o) {
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return id.hashCode();
diff --git a/src/main/java/org/kohsuke/github/GHGistBuilder.java b/src/main/java/org/kohsuke/github/GHGistBuilder.java
index e7ba88965c..c2797b628c 100644
--- a/src/main/java/org/kohsuke/github/GHGistBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHGistBuilder.java
@@ -6,6 +6,7 @@
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* Builder pattern for creating a new Gist.
*
diff --git a/src/main/java/org/kohsuke/github/GHGistFile.java b/src/main/java/org/kohsuke/github/GHGistFile.java
index c143bf2a10..67237094d1 100644
--- a/src/main/java/org/kohsuke/github/GHGistFile.java
+++ b/src/main/java/org/kohsuke/github/GHGistFile.java
@@ -1,13 +1,16 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
- * A file inside {@link GHGist}
+ * A file inside {@link GHGist}.
*
* @author Kohsuke Kawaguchi
* @see GHGist#getFile(String) GHGist#getFile(String)
* @see GHGist#getFiles() GHGist#getFiles()
*/
public class GHGistFile {
+
+ /** The file name. */
/* package almost final */ String fileName;
private int size;
@@ -42,7 +45,7 @@ public String getRawUrl() {
}
/**
- * Content type of this Gist, such as "text/plain"
+ * Content type of this Gist, such as "text/plain".
*
* @return the type
*/
diff --git a/src/main/java/org/kohsuke/github/GHGistUpdater.java b/src/main/java/org/kohsuke/github/GHGistUpdater.java
index ebba8c6f9f..5faaccde4d 100644
--- a/src/main/java/org/kohsuke/github/GHGistUpdater.java
+++ b/src/main/java/org/kohsuke/github/GHGistUpdater.java
@@ -7,6 +7,7 @@
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* Builder pattern for updating a Gist.
*
@@ -15,8 +16,16 @@
public class GHGistUpdater {
private final GHGist base;
private final Requester builder;
+
+ /** The files. */
LinkedHashMap> files;
+ /**
+ * Instantiates a new GH gist updater.
+ *
+ * @param base
+ * the base
+ */
GHGistUpdater(GHGist base) {
this.base = base;
this.builder = base.root().createRequest();
@@ -40,6 +49,15 @@ public GHGistUpdater addFile(@Nonnull String fileName, @Nonnull String content)
return this;
}
+ /**
+ * Delete file.
+ *
+ * @param fileName
+ * the file name
+ * @return the GH gist updater
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public GHGistUpdater deleteFile(@Nonnull String fileName) throws IOException {
files.put(fileName, null);
return this;
@@ -80,7 +98,7 @@ public GHGistUpdater updateFile(@Nonnull String fileName, @Nonnull String conten
}
/**
- * Update file name and content
+ * Update file name and content.
*
* @param fileName
* the file name
diff --git a/src/main/java/org/kohsuke/github/GHHook.java b/src/main/java/org/kohsuke/github/GHHook.java
index a94e8f1a7f..08f2b9e798 100644
--- a/src/main/java/org/kohsuke/github/GHHook.java
+++ b/src/main/java/org/kohsuke/github/GHHook.java
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;
+// TODO: Auto-generated Javadoc
/**
* The type GHHook.
*
@@ -18,9 +19,17 @@
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
public abstract class GHHook extends GHObject {
+
+ /** The name. */
String name;
+
+ /** The events. */
List events;
+
+ /** The active. */
boolean active;
+
+ /** The config. */
Map config;
/**
@@ -85,6 +94,9 @@ public void delete() throws IOException {
}
/**
+ * Gets the html url.
+ *
+ * @return the html url
* @deprecated This object has no HTML URL.
*/
@Override
@@ -92,7 +104,17 @@ public URL getHtmlUrl() {
return null;
}
+ /**
+ * Root.
+ *
+ * @return the git hub
+ */
abstract GitHub root();
+ /**
+ * Gets the api route.
+ *
+ * @return the api route
+ */
abstract String getApiRoute();
}
diff --git a/src/main/java/org/kohsuke/github/GHHooks.java b/src/main/java/org/kohsuke/github/GHHooks.java
index 58ca576b3a..addcad3179 100644
--- a/src/main/java/org/kohsuke/github/GHHooks.java
+++ b/src/main/java/org/kohsuke/github/GHHooks.java
@@ -7,11 +7,16 @@
import java.util.List;
import java.util.Map;
+// TODO: Auto-generated Javadoc
/**
* Utility class for creating and retrieving webhooks; removes duplication between GHOrganization and GHRepository
- * functionality
+ * functionality.
*/
class GHHooks {
+
+ /**
+ * The Class Context.
+ */
static abstract class Context extends GitHubInteractiveObject {
private Context(GitHub root) {
@@ -99,12 +104,34 @@ public void deleteHook(int id) throws IOException {
root().createRequest().method("DELETE").withUrlPath(collection() + "/" + id).send();
}
+ /**
+ * Collection.
+ *
+ * @return the string
+ */
abstract String collection();
+ /**
+ * Collection class.
+ *
+ * @return the class extends GH hook[]>
+ */
abstract Class extends GHHook[]> collectionClass();
+ /**
+ * Clazz.
+ *
+ * @return the class extends GH hook>
+ */
abstract Class extends GHHook> clazz();
+ /**
+ * Wrap.
+ *
+ * @param hook
+ * the hook
+ * @return the GH hook
+ */
abstract GHHook wrap(GHHook hook);
}
@@ -168,10 +195,26 @@ GHHook wrap(GHHook hook) {
}
}
+ /**
+ * Repo context.
+ *
+ * @param repository
+ * the repository
+ * @param owner
+ * the owner
+ * @return the context
+ */
static Context repoContext(GHRepository repository, GHUser owner) {
return new RepoContext(repository, owner);
}
+ /**
+ * Org context.
+ *
+ * @param organization
+ * the organization
+ * @return the context
+ */
static Context orgContext(GHOrganization organization) {
return new OrgContext(organization);
}
diff --git a/src/main/java/org/kohsuke/github/GHIOException.java b/src/main/java/org/kohsuke/github/GHIOException.java
index b8d8864dc6..2654e845ab 100644
--- a/src/main/java/org/kohsuke/github/GHIOException.java
+++ b/src/main/java/org/kohsuke/github/GHIOException.java
@@ -8,12 +8,15 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
- * Request/responce contains useful metadata. Custom exception allows store info for next diagnostics.
+ * Request/response contains useful metadata. Custom exception allows store info for next diagnostics.
*
* @author Kanstantsin Shautsou
*/
public class GHIOException extends IOException {
+
+ /** The response header fields. */
protected Map> responseHeaderFields;
/**
@@ -56,6 +59,13 @@ public Map> getResponseHeaderFields() {
return Collections.unmodifiableMap(responseHeaderFields);
}
+ /**
+ * With response header fields.
+ *
+ * @param headerFields
+ * the header fields
+ * @return the GHIO exception
+ */
GHIOException withResponseHeaderFields(@Nonnull Map> headerFields) {
this.responseHeaderFields = headerFields;
return this;
diff --git a/src/main/java/org/kohsuke/github/GHInvitation.java b/src/main/java/org/kohsuke/github/GHInvitation.java
index 5da36bf613..4985bb9c1e 100644
--- a/src/main/java/org/kohsuke/github/GHInvitation.java
+++ b/src/main/java/org/kohsuke/github/GHInvitation.java
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
* The type GHInvitation.
*
@@ -43,6 +44,11 @@ public void decline() throws IOException {
root().createRequest().method("DELETE").withUrlPath("/user/repository_invitations/" + id).send();
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
diff --git a/src/main/java/org/kohsuke/github/GHIssue.java b/src/main/java/org/kohsuke/github/GHIssue.java
index 1b52c3bf9a..9d6027f331 100644
--- a/src/main/java/org/kohsuke/github/GHIssue.java
+++ b/src/main/java/org/kohsuke/github/GHIssue.java
@@ -41,6 +41,7 @@
import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
+// TODO: Auto-generated Javadoc
/**
* Represents an issue on GitHub.
*
@@ -53,25 +54,60 @@
public class GHIssue extends GHObject implements Reactable {
private static final String ASSIGNEES = "assignees";
+ /** The owner. */
GHRepository owner;
+ /** The assignee. */
// API v3
protected GHUser assignee; // not sure what this field is now that 'assignees' exist
+
+ /** The assignees. */
protected GHUser[] assignees;
+
+ /** The state. */
protected String state;
+
+ /** The number. */
protected int number;
+
+ /** The closed at. */
protected String closed_at;
+
+ /** The comments. */
protected int comments;
+
+ /** The body. */
@SkipFromToString
protected String body;
+
+ /** The labels. */
protected List labels;
+
+ /** The user. */
protected GHUser user;
+
+ /** The html url. */
protected String title, html_url;
+
+ /** The pull request. */
protected GHIssue.PullRequest pull_request;
+
+ /** The milestone. */
protected GHMilestone milestone;
+
+ /** The closed by. */
protected GHUser closed_by;
+
+ /** The locked. */
protected boolean locked;
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH issue
+ */
GHIssue wrap(GHRepository owner) {
this.owner = owner;
if (milestone != null)
@@ -128,6 +164,8 @@ public int getNumber() {
/**
* The HTML page of this issue, like https://github.com/jenkinsci/jenkins/issues/100
+ *
+ * @return the html url
*/
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
@@ -335,9 +373,9 @@ public void setLabels(String... labels) throws IOException {
*
* Labels that are already present on the target are ignored.
*
- * @return the complete list of labels including the new additions
* @param names
* Names of the label
+ * @return the complete list of labels including the new additions
* @throws IOException
* the io exception
*/
@@ -351,9 +389,9 @@ public List addLabels(String... names) throws IOException {
*
* Labels that are already present on the target are ignored.
*
- * @return the complete list of labels including the new additions
* @param labels
* the labels
+ * @return the complete list of labels including the new additions
* @throws IOException
* the io exception
*/
@@ -367,9 +405,9 @@ public List addLabels(GHLabel... labels) throws IOException {
*
* Labels that are already present on the target are ignored.
*
- * @return the complete list of labels including the new additions
* @param labels
* the labels
+ * @return the complete list of labels including the new additions
* @throws IOException
* the io exception
*/
@@ -391,9 +429,9 @@ private List _addLabels(Collection names) throws IOException {
*
* Attempting to remove a label that is not present throws {@link GHFileNotFoundException}.
*
- * @return the remaining list of labels
* @param name
* the name
+ * @return the remaining list of labels
* @throws IOException
* the io exception, throws {@link GHFileNotFoundException} if label was not present.
*/
@@ -410,9 +448,9 @@ public List removeLabel(String name) throws IOException {
*
* Attempting to remove labels that are not present on the target are ignored.
*
- * @return the remaining list of labels
* @param names
* the names
+ * @return the remaining list of labels
* @throws IOException
* the io exception
*/
@@ -426,9 +464,9 @@ public List removeLabels(String... names) throws IOException {
*
* Attempting to remove labels that are not present on the target are ignored.
*
- * @return the remaining list of labels
* @param labels
* the labels
+ * @return the remaining list of labels
* @throws IOException
* the io exception
* @see #removeLabels(String...) #removeLabels(String...)
@@ -443,9 +481,9 @@ public List removeLabels(GHLabel... labels) throws IOException {
*
* Attempting to remove labels that are not present on the target are ignored.
*
- * @return the remaining list of labels
* @param labels
* the labels
+ * @return the remaining list of labels
* @throws IOException
* the io exception
*/
@@ -479,11 +517,13 @@ public List getComments() throws IOException {
}
/**
- * Obtains all the comments associated with this issue.
+ * Obtains all the comments associated with this issue, without any filter.
*
* @return the paged iterable
* @throws IOException
* the io exception
+ * @see List issue comments
+ * @see #queryComments() queryComments to apply filters.
*/
public PagedIterable listComments() throws IOException {
return root().createRequest()
@@ -491,6 +531,25 @@ public PagedIterable listComments() throws IOException {
.toIterable(GHIssueComment[].class, item -> item.wrapUp(this));
}
+ /**
+ * Search comments on this issue by specifying filters through a builder pattern.
+ *
+ * @return the query builder
+ * @see List issue comments
+ */
+ public GHIssueCommentQueryBuilder queryComments() {
+ return new GHIssueCommentQueryBuilder(this);
+ }
+
+ /**
+ * Creates the reaction.
+ *
+ * @param content
+ * the content
+ * @return the GH reaction
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Preview(SQUIRREL_GIRL)
public GHReaction createReaction(ReactionContent content) throws IOException {
return root().createRequest()
@@ -501,6 +560,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
.fetch(GHReaction.class);
}
+ /**
+ * Delete reaction.
+ *
+ * @param reaction
+ * the reaction
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public void deleteReaction(GHReaction reaction) throws IOException {
owner.root()
.createRequest()
@@ -509,6 +576,11 @@ public void deleteReaction(GHReaction reaction) throws IOException {
.send();
}
+ /**
+ * List reactions.
+ *
+ * @return the paged iterable
+ */
@Preview(SQUIRREL_GIRL)
public PagedIterable listReactions() {
return root().createRequest()
@@ -751,6 +823,13 @@ public URL getUrl() {
}
}
+ /**
+ * Gets the logins.
+ *
+ * @param users
+ * the users
+ * @return the logins
+ */
protected static List getLogins(Collection users) {
List names = new ArrayList(users.size());
for (GHUser a : users) {
diff --git a/src/main/java/org/kohsuke/github/GHIssueBuilder.java b/src/main/java/org/kohsuke/github/GHIssueBuilder.java
index 52ca1661e6..0d904c4fb2 100644
--- a/src/main/java/org/kohsuke/github/GHIssueBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHIssueBuilder.java
@@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* The type GHIssueBuilder.
*
@@ -15,6 +16,14 @@ public class GHIssueBuilder {
private List labels = new ArrayList();
private List assignees = new ArrayList();
+ /**
+ * Instantiates a new GH issue builder.
+ *
+ * @param repo
+ * the repo
+ * @param title
+ * the title
+ */
GHIssueBuilder(GHRepository repo, String title) {
this.repo = repo;
this.builder = repo.root().createRequest().method("POST");
diff --git a/src/main/java/org/kohsuke/github/GHIssueChanges.java b/src/main/java/org/kohsuke/github/GHIssueChanges.java
index 4f861ddae9..41d948cda2 100644
--- a/src/main/java/org/kohsuke/github/GHIssueChanges.java
+++ b/src/main/java/org/kohsuke/github/GHIssueChanges.java
@@ -2,8 +2,9 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
- * Wrapper to define changed fields on issues action="edited"
+ * Wrapper to define changed fields on issues action="edited".
*
* @see GHEventPayload.Issue
*/
diff --git a/src/main/java/org/kohsuke/github/GHIssueComment.java b/src/main/java/org/kohsuke/github/GHIssueComment.java
index 3f6fb08d92..37be280ce3 100644
--- a/src/main/java/org/kohsuke/github/GHIssueComment.java
+++ b/src/main/java/org/kohsuke/github/GHIssueComment.java
@@ -30,19 +30,29 @@
import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
+// TODO: Auto-generated Javadoc
/**
- * Comment to the issue
+ * Comment to the issue.
*
* @author Kohsuke Kawaguchi
* @see GHIssue#comment(String) GHIssue#comment(String)
* @see GHIssue#listComments() GHIssue#listComments()
*/
public class GHIssueComment extends GHObject implements Reactable {
+
+ /** The owner. */
GHIssue owner;
private String body, gravatar_id, html_url, author_association;
private GHUser user; // not fully populated. beware.
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH issue comment
+ */
GHIssueComment wrapUp(GHIssue owner) {
this.owner = owner;
return this;
@@ -88,6 +98,11 @@ public GHUser getUser() throws IOException {
return owner == null || owner.isOffline() ? user : owner.root().getUser(user.getLogin());
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
@@ -130,6 +145,15 @@ public void delete() throws IOException {
owner.root().createRequest().method("DELETE").withUrlPath(getApiRoute()).send();
}
+ /**
+ * Creates the reaction.
+ *
+ * @param content
+ * the content
+ * @return the GH reaction
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Preview(SQUIRREL_GIRL)
public GHReaction createReaction(ReactionContent content) throws IOException {
return owner.root()
@@ -141,6 +165,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
.fetch(GHReaction.class);
}
+ /**
+ * Delete reaction.
+ *
+ * @param reaction
+ * the reaction
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public void deleteReaction(GHReaction reaction) throws IOException {
owner.root()
.createRequest()
@@ -149,6 +181,11 @@ public void deleteReaction(GHReaction reaction) throws IOException {
.send();
}
+ /**
+ * List reactions.
+ *
+ * @return the paged iterable
+ */
@Preview(SQUIRREL_GIRL)
public PagedIterable listReactions() {
return owner.root()
diff --git a/src/main/java/org/kohsuke/github/GHIssueCommentQueryBuilder.java b/src/main/java/org/kohsuke/github/GHIssueCommentQueryBuilder.java
new file mode 100644
index 0000000000..d39df0d475
--- /dev/null
+++ b/src/main/java/org/kohsuke/github/GHIssueCommentQueryBuilder.java
@@ -0,0 +1,68 @@
+package org.kohsuke.github;
+
+import java.util.Date;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Builds a query for listing comments on an issue.
+ *
+ * Call various methods that set the filter criteria, then the {@link #list()} method to actually retrieve the comments.
+ *
+ *
+ * GHIssue issue = ...;
+ * for (GHIssueComment comment : issue.queryComments().since(x).list()) {
+ * ...
+ * }
+ *
+ *
+ * @author Yoann Rodiere
+ * @see GHIssue#queryComments() GHIssue#queryComments()
+ * @see List issue comments
+ */
+public class GHIssueCommentQueryBuilder {
+ private final Requester req;
+ private final GHIssue issue;
+
+ /**
+ * Instantiates a new GH issue comment query builder.
+ *
+ * @param issue
+ * the issue
+ */
+ GHIssueCommentQueryBuilder(GHIssue issue) {
+ this.issue = issue;
+ this.req = issue.root().createRequest().withUrlPath(issue.getIssuesApiRoute() + "/comments");
+ }
+
+ /**
+ * Only comments created/updated after this date will be returned.
+ *
+ * @param date
+ * the date
+ * @return the query builder
+ */
+ public GHIssueCommentQueryBuilder since(Date date) {
+ req.with("since", GitHubClient.printDate(date));
+ return this;
+ }
+
+ /**
+ * Only comments created/updated after this timestamp will be returned.
+ *
+ * @param timestamp
+ * the timestamp
+ * @return the query builder
+ */
+ public GHIssueCommentQueryBuilder since(long timestamp) {
+ return since(new Date(timestamp));
+ }
+
+ /**
+ * Lists up the comments with the criteria added so far.
+ *
+ * @return the paged iterable
+ */
+ public PagedIterable list() {
+ return req.toIterable(GHIssueComment[].class, item -> item.wrapUp(issue));
+ }
+}
diff --git a/src/main/java/org/kohsuke/github/GHIssueEvent.java b/src/main/java/org/kohsuke/github/GHIssueEvent.java
index 2d35760089..6026e43ad4 100644
--- a/src/main/java/org/kohsuke/github/GHIssueEvent.java
+++ b/src/main/java/org/kohsuke/github/GHIssueEvent.java
@@ -4,12 +4,12 @@
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* The type GHIssueEvent.
*
- * @see Github documentation for issue events
- *
* @author Martin van Zijl
+ * @see Github documentation for issue events
*/
public class GHIssueEvent extends GitHubInteractiveObject {
private long id;
@@ -189,11 +189,23 @@ public GHUser getRequestedReviewer() {
return this.requestedReviewer;
}
+ /**
+ * Wrap up.
+ *
+ * @param parent
+ * the parent
+ * @return the GH issue event
+ */
GHIssueEvent wrapUp(GHIssue parent) {
this.issue = parent;
return this;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return String.format("Issue %d was %s by %s on %s",
diff --git a/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java b/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java
index 2b06073d6a..cf43cb6391 100644
--- a/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHIssueQueryBuilder.java
@@ -4,9 +4,19 @@
import java.util.Date;
import java.util.List;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GHIssueQueryBuilder.
+ */
public abstract class GHIssueQueryBuilder extends GHQueryBuilder {
private final List labels = new ArrayList<>();
+ /**
+ * Instantiates a new GH issue query builder.
+ *
+ * @param root
+ * the root
+ */
GHIssueQueryBuilder(GitHub root) {
super(root);
}
@@ -101,7 +111,13 @@ public GHIssueQueryBuilder pageSize(int pageSize) {
* The enum Sort.
*/
public enum Sort {
- CREATED, UPDATED, COMMENTS
+
+ /** The created. */
+ CREATED,
+ /** The updated. */
+ UPDATED,
+ /** The comments. */
+ COMMENTS
}
/**
@@ -111,9 +127,18 @@ public enum Sort {
*/
public abstract String getApiUrl();
+ /**
+ * The Class ForRepository.
+ */
public static class ForRepository extends GHIssueQueryBuilder {
private final GHRepository repo;
+ /**
+ * Instantiates a new for repository.
+ *
+ * @param repo
+ * the repo
+ */
ForRepository(final GHRepository repo) {
super(repo.root());
this.repo = repo;
@@ -170,11 +195,21 @@ public ForRepository mentioned(String mentioned) {
return this;
}
+ /**
+ * Gets the api url.
+ *
+ * @return the api url
+ */
@Override
public String getApiUrl() {
return repo.getApiTailUrl("issues");
}
+ /**
+ * List.
+ *
+ * @return the paged iterable
+ */
@Override
public PagedIterable list() {
return req.withUrlPath(getApiUrl()).toIterable(GHIssue[].class, item -> item.wrap(repo));
diff --git a/src/main/java/org/kohsuke/github/GHIssueRename.java b/src/main/java/org/kohsuke/github/GHIssueRename.java
index 6a08754a10..e1bcf0211a 100644
--- a/src/main/java/org/kohsuke/github/GHIssueRename.java
+++ b/src/main/java/org/kohsuke/github/GHIssueRename.java
@@ -1,12 +1,12 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* The type GHIssueRename.
*
+ * @author Andrii Tomchuk
* @see Github
* documentation for renamed event
- *
- * @author Andrii Tomchuk
*/
public class GHIssueRename {
private String from = "";
diff --git a/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java b/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java
index 84739b15ef..92deb26ccf 100644
--- a/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Search issues.
*
@@ -7,12 +8,23 @@
* @see GitHub#searchIssues() GitHub#searchIssues()
*/
public class GHIssueSearchBuilder extends GHSearchBuilder {
+
+ /**
+ * Instantiates a new GH issue search builder.
+ *
+ * @param root
+ * the root
+ */
GHIssueSearchBuilder(GitHub root) {
super(root, IssueSearchResult.class);
}
/**
* Search terms.
+ *
+ * @param term
+ * the term
+ * @return the GH issue search builder
*/
public GHIssueSearchBuilder q(String term) {
super.q(term);
@@ -96,7 +108,13 @@ public GHIssueSearchBuilder sort(Sort sort) {
* The enum Sort.
*/
public enum Sort {
- COMMENTS, CREATED, UPDATED
+
+ /** The comments. */
+ COMMENTS,
+ /** The created. */
+ CREATED,
+ /** The updated. */
+ UPDATED
}
private static class IssueSearchResult extends SearchResult {
@@ -110,6 +128,11 @@ GHIssue[] getItems(GitHub root) {
}
}
+ /**
+ * Gets the api url.
+ *
+ * @return the api url
+ */
@Override
protected String getApiUrl() {
return "/search/issues";
diff --git a/src/main/java/org/kohsuke/github/GHIssueState.java b/src/main/java/org/kohsuke/github/GHIssueState.java
index 382d565125..17a69251e2 100644
--- a/src/main/java/org/kohsuke/github/GHIssueState.java
+++ b/src/main/java/org/kohsuke/github/GHIssueState.java
@@ -24,11 +24,18 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* The enum GHIssueState.
*
* @see GHPullRequestQueryBuilder#state(GHIssueState) GHPullRequestQueryBuilder#state(GHIssueState)
*/
public enum GHIssueState {
- OPEN, CLOSED, ALL
+
+ /** The open. */
+ OPEN,
+ /** The closed. */
+ CLOSED,
+ /** The all. */
+ ALL
}
diff --git a/src/main/java/org/kohsuke/github/GHKey.java b/src/main/java/org/kohsuke/github/GHKey.java
index 8963bf1f55..01c73819b2 100644
--- a/src/main/java/org/kohsuke/github/GHKey.java
+++ b/src/main/java/org/kohsuke/github/GHKey.java
@@ -3,6 +3,9 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.builder.ToStringBuilder;
+import java.io.IOException;
+
+// TODO: Auto-generated Javadoc
/**
* SSH public key.
*
@@ -10,8 +13,14 @@
*/
@SuppressFBWarnings(value = "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", justification = "JSON API")
public class GHKey extends GitHubInteractiveObject {
+
+ /** The title. */
protected String url, key, title;
+
+ /** The verified. */
protected boolean verified;
+
+ /** The id. */
protected int id;
/**
@@ -59,7 +68,22 @@ public boolean isVerified() {
return verified;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
public String toString() {
return new ToStringBuilder(this).append("title", title).append("id", id).append("key", key).toString();
}
+
+ /**
+ * Delete the GHKey
+ *
+ * @throws IOException
+ * the io exception
+ */
+ public void delete() throws IOException {
+ root().createRequest().method("DELETE").withUrlPath(String.format("/user/keys/%d", id)).send();
+ }
}
diff --git a/src/main/java/org/kohsuke/github/GHLabel.java b/src/main/java/org/kohsuke/github/GHLabel.java
index c332ceaeab..46c5af2069 100644
--- a/src/main/java/org/kohsuke/github/GHLabel.java
+++ b/src/main/java/org/kohsuke/github/GHLabel.java
@@ -13,6 +13,7 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* The type GHLabel.
*
@@ -42,6 +43,11 @@ private GHLabel(@JacksonInject @Nonnull GitHub root) {
description = null;
}
+ /**
+ * Gets the api root.
+ *
+ * @return the api root
+ */
@Nonnull
GitHub getApiRoot() {
return Objects.requireNonNull(root());
@@ -86,7 +92,7 @@ public String getName() {
}
/**
- * Color code without leading '#', such as 'f29513'
+ * Color code without leading '#', such as 'f29513'.
*
* @return the color
*/
@@ -96,7 +102,7 @@ public String getColor() {
}
/**
- * Purpose of Label
+ * Purpose of Label.
*
* @return the description
*/
@@ -142,6 +148,13 @@ public void setDescription(String newDescription) throws IOException {
set().description(newDescription);
}
+ /**
+ * To names.
+ *
+ * @param labels
+ * the labels
+ * @return the collection
+ */
static Collection toNames(Collection labels) {
List r = new ArrayList<>();
for (GHLabel l : labels) {
@@ -234,6 +247,13 @@ public void delete() throws IOException {
root().createRequest().method("DELETE").setRawUrlPath(getUrl()).send();
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(final Object o) {
if (this == o)
@@ -245,6 +265,11 @@ public boolean equals(final Object o) {
&& Objects.equals(color, ghLabel.color) && Objects.equals(description, ghLabel.description);
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return Objects.hash(url, name, color, description);
diff --git a/src/main/java/org/kohsuke/github/GHLabelBuilder.java b/src/main/java/org/kohsuke/github/GHLabelBuilder.java
index a7d13fa8a9..3803a7de8e 100644
--- a/src/main/java/org/kohsuke/github/GHLabelBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHLabelBuilder.java
@@ -5,7 +5,9 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
+ * The Class GHLabelBuilder.
*
* @param
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If {@link S}
@@ -15,6 +17,7 @@
class GHLabelBuilder extends AbstractBuilder {
/**
+ * Instantiates a new GH label builder.
*
* @param intermediateReturnType
* Intermediate return type for this builder returned by calls to {@link #with(String, Object)}. If
@@ -37,18 +40,45 @@ protected GHLabelBuilder(@Nonnull Class intermediateReturnType,
}
}
+ /**
+ * Name.
+ *
+ * @param value
+ * the value
+ * @return the s
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Nonnull
@BetaApi
public S name(String value) throws IOException {
return with("name", value);
}
+ /**
+ * Color.
+ *
+ * @param value
+ * the value
+ * @return the s
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Nonnull
@BetaApi
public S color(String value) throws IOException {
return with("color", value);
}
+ /**
+ * Description.
+ *
+ * @param value
+ * the value
+ * @return the s
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Nonnull
@BetaApi
public S description(String value) throws IOException {
diff --git a/src/main/java/org/kohsuke/github/GHLabelChanges.java b/src/main/java/org/kohsuke/github/GHLabelChanges.java
index b3f5c8cfd2..7048acd93d 100644
--- a/src/main/java/org/kohsuke/github/GHLabelChanges.java
+++ b/src/main/java/org/kohsuke/github/GHLabelChanges.java
@@ -2,8 +2,9 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
- * Wrapper to define changed fields on label action="edited"
+ * Wrapper to define changed fields on label action="edited".
*
* @see GHEventPayload.Label
*/
diff --git a/src/main/java/org/kohsuke/github/GHLicense.java b/src/main/java/org/kohsuke/github/GHLicense.java
index 9dfd5fbba7..89cc08cf2a 100644
--- a/src/main/java/org/kohsuke/github/GHLicense.java
+++ b/src/main/java/org/kohsuke/github/GHLicense.java
@@ -33,8 +33,9 @@
import java.util.List;
import java.util.Objects;
+// TODO: Auto-generated Javadoc
/**
- * The GitHub Preview API's license information
+ * The GitHub Preview API's license information.
*
* @author Duncan Dickinson
* @see GitHub#getLicense(String) GitHub#getLicense(String)
@@ -46,16 +47,24 @@
justification = "JSON API")
public class GHLicense extends GHObject {
+ /** The name. */
// these fields are always present, even in the short form
protected String key, name;
+ /** The featured. */
// the rest is only after populated
protected Boolean featured;
+ /** The body. */
protected String html_url, description, category, implementation, body;
+ /** The required. */
protected List required = new ArrayList();
+
+ /** The permitted. */
protected List permitted = new ArrayList();
+
+ /** The forbidden. */
protected List forbidden = new ArrayList();
/**
@@ -77,7 +86,7 @@ public String getName() {
}
/**
- * Featured licenses are bold in the new repository drop-down
+ * Featured licenses are bold in the new repository drop-down.
*
* @return True if the license is featured, false otherwise
* @throws IOException
@@ -88,6 +97,13 @@ public Boolean isFeatured() throws IOException {
return featured;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public URL getHtmlUrl() throws IOException {
populate();
return GitHubClient.parseURL(html_url);
@@ -199,6 +215,13 @@ protected synchronized void populate() throws IOException {
}
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(Object o) {
if (this == o)
@@ -210,6 +233,11 @@ public boolean equals(Object o) {
return Objects.equals(getUrl(), that.getUrl());
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return Objects.hashCode(getUrl());
diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java b/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java
index 3ddd8546f0..ddc28ad1df 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplaceAccount.java
@@ -2,6 +2,7 @@
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
* Base class for Github Marketplace Account.
*
diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java b/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java
index 8750da134c..b2df88e8de 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplaceAccountPlan.java
@@ -2,6 +2,7 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
* A Github Marketplace Account Plan.
*
diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java b/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java
index 1e0ba96e3a..416dadc596 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplaceAccountType.java
@@ -4,6 +4,7 @@
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* GitHub Marketplace Account type.
*
@@ -11,10 +12,16 @@
* @see GHMarketplaceAccount
*/
public enum GHMarketplaceAccountType {
- ORGANIZATION, USER;
+
+ /** The organization. */
+ ORGANIZATION,
+ /** The user. */
+ USER;
/**
* Returns GitHub's internal representation of this event.
+ *
+ * @return the string
*/
String symbol() {
return StringUtils.capitalize(name().toLowerCase(Locale.ENGLISH));
diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java b/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java
index 32f4b1a1dd..1e061a36c3 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplaceListAccountBuilder.java
@@ -2,8 +2,9 @@
import java.io.IOException;
+// TODO: Auto-generated Javadoc
/**
- * Returns any accounts associated with a plan, including free plans
+ * Returns any accounts associated with a plan, including free plans.
*
* @author Paulo Miguel Almeida
* @see GHMarketplacePlan#listAccounts()
@@ -12,6 +13,14 @@ public class GHMarketplaceListAccountBuilder extends GitHubInteractiveObject {
private final Requester builder;
private final long planId;
+ /**
+ * Instantiates a new GH marketplace list account builder.
+ *
+ * @param root
+ * the root
+ * @param planId
+ * the plan id
+ */
GHMarketplaceListAccountBuilder(GitHub root, long planId) {
super(root);
this.builder = root.createRequest();
@@ -48,7 +57,11 @@ public GHMarketplaceListAccountBuilder direction(GHDirection direction) {
* The enum Sort.
*/
public enum Sort {
- CREATED, UPDATED
+
+ /** The created. */
+ CREATED,
+ /** The updated. */
+ UPDATED
}
/**
diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java b/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java
index 4f5ed509c0..d8bb2ebc34 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplacePendingChange.java
@@ -4,6 +4,7 @@
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* A Github Marketplace purchase pending change.
*
diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePlan.java b/src/main/java/org/kohsuke/github/GHMarketplacePlan.java
index 1c638e4fd8..95a405bfa4 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplacePlan.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplacePlan.java
@@ -6,6 +6,7 @@
import java.util.Collections;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* A Github Marketplace plan.
*
diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java b/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java
index 0c8fb83782..f8a0c5104d 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplacePriceModel.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonValue;
+// TODO: Auto-generated Javadoc
/**
* GitHub Marketplace plan pricing model.
*
@@ -9,11 +10,23 @@
* @see GHMarketplacePlan
*/
public enum GHMarketplacePriceModel {
- FREE("free"), PER_UNIT("per-unit"), FLAT_RATE("flat-rate");
+
+ /** The free. */
+ FREE("free"),
+ /** The per unit. */
+ PER_UNIT("per-unit"),
+ /** The flat rate. */
+ FLAT_RATE("flat-rate");
@JsonValue
private final String internalName;
+ /**
+ * Instantiates a new GH marketplace price model.
+ *
+ * @param internalName
+ * the internal name
+ */
GHMarketplacePriceModel(String internalName) {
this.internalName = internalName;
}
diff --git a/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java b/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java
index 12a8ec8fff..f4de6c42ee 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplacePurchase.java
@@ -4,6 +4,7 @@
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* A Github Marketplace purchase.
*
diff --git a/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java b/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java
index 2e6e22e8e4..8802f5a8f5 100644
--- a/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java
+++ b/src/main/java/org/kohsuke/github/GHMarketplaceUserPurchase.java
@@ -4,8 +4,9 @@
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
- * Github Marketplace User Purchase
+ * Github Marketplace User Purchase.
*
* @author Paulo Miguel Almeida
* @see GitHub#getMyMarketplacePurchases()
diff --git a/src/main/java/org/kohsuke/github/GHMembership.java b/src/main/java/org/kohsuke/github/GHMembership.java
index 074c5fd355..e8e012c995 100644
--- a/src/main/java/org/kohsuke/github/GHMembership.java
+++ b/src/main/java/org/kohsuke/github/GHMembership.java
@@ -6,6 +6,7 @@
import java.net.URL;
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* Represents a membership of a user in an organization.
*
@@ -13,10 +14,20 @@
* @see GHMyself#listOrgMemberships() GHMyself#listOrgMemberships()
*/
public class GHMembership extends GitHubInteractiveObject {
+
+ /** The url. */
String url;
+
+ /** The state. */
String state;
+
+ /** The role. */
String role;
+
+ /** The user. */
GHUser user;
+
+ /** The organization. */
GHOrganization organization;
/**
@@ -77,6 +88,13 @@ public void activate() throws IOException {
root().createRequest().method("PATCH").with("state", State.ACTIVE).withUrlPath(url).fetchInto(this);
}
+ /**
+ * Wrap.
+ *
+ * @param root
+ * the root
+ * @return the GH membership
+ */
GHMembership wrap(GitHub root) {
if (user != null)
user = root.getUser(user);
@@ -98,9 +116,13 @@ public enum Role {
}
/**
- * Whether a role is currently active or waiting for acceptance (pending)
+ * Whether a role is currently active or waiting for acceptance (pending).
*/
public enum State {
- ACTIVE, PENDING;
+
+ /** The active. */
+ ACTIVE,
+ /** The pending. */
+ PENDING;
}
}
diff --git a/src/main/java/org/kohsuke/github/GHMeta.java b/src/main/java/org/kohsuke/github/GHMeta.java
index b77f530b82..7d667f87c7 100644
--- a/src/main/java/org/kohsuke/github/GHMeta.java
+++ b/src/main/java/org/kohsuke/github/GHMeta.java
@@ -6,6 +6,7 @@
import java.util.Collections;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* Class that wraps the list of GitHub's IP addresses.
*
diff --git a/src/main/java/org/kohsuke/github/GHMilestone.java b/src/main/java/org/kohsuke/github/GHMilestone.java
index 32a1c9a6fe..0bb7481a1a 100644
--- a/src/main/java/org/kohsuke/github/GHMilestone.java
+++ b/src/main/java/org/kohsuke/github/GHMilestone.java
@@ -7,17 +7,23 @@
import java.util.Date;
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* The type GHMilestone.
*
* @author Yusuke Kokubo
*/
public class GHMilestone extends GHObject {
+
+ /** The owner. */
GHRepository owner;
+ /** The creator. */
GHUser creator;
private String state, due_on, title, description, html_url;
private int closed_issues, open_issues, number;
+
+ /** The closed at. */
protected String closed_at;
/**
@@ -53,7 +59,7 @@ public Date getDueOn() {
}
/**
- * When was this milestone closed?
+ * When was this milestone closed?.
*
* @return the closed at
* @throws IOException
@@ -108,6 +114,11 @@ public int getNumber() {
return number;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
}
diff --git a/src/main/java/org/kohsuke/github/GHMilestoneState.java b/src/main/java/org/kohsuke/github/GHMilestoneState.java
index f46c775432..85dcb9d5f4 100644
--- a/src/main/java/org/kohsuke/github/GHMilestoneState.java
+++ b/src/main/java/org/kohsuke/github/GHMilestoneState.java
@@ -1,10 +1,15 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* The enum GHMilestoneState.
*
* @author Yusuke Kokubo
*/
public enum GHMilestoneState {
- OPEN, CLOSED
+
+ /** The open. */
+ OPEN,
+ /** The closed. */
+ CLOSED
}
diff --git a/src/main/java/org/kohsuke/github/GHMyself.java b/src/main/java/org/kohsuke/github/GHMyself.java
index b5b078629c..43914f2bd2 100644
--- a/src/main/java/org/kohsuke/github/GHMyself.java
+++ b/src/main/java/org/kohsuke/github/GHMyself.java
@@ -9,6 +9,7 @@
import java.util.Set;
import java.util.TreeMap;
+// TODO: Auto-generated Javadoc
/**
* Represents the account that's logging into GitHub.
*
@@ -20,25 +21,20 @@ public class GHMyself extends GHUser {
* Type of repositories returned during listing.
*/
public enum RepositoryListFilter {
- /**
- * All public and private repositories that current user has access or collaborates to
- */
+
+ /** All public and private repositories that current user has access or collaborates to. */
ALL,
- /**
- * Public and private repositories owned by current user
- */
+
+ /** Public and private repositories owned by current user. */
OWNER,
- /**
- * Public repositories that current user has access or collaborates to
- */
+
+ /** Public repositories that current user has access or collaborates to. */
PUBLIC,
- /**
- * Private repositories that current user has access or collaborates to
- */
+
+ /** Private repositories that current user has access or collaborates to. */
PRIVATE,
- /**
- * Public and private repositories that current user is a member
- */
+
+ /** Public and private repositories that current user is a member. */
MEMBER;
}
@@ -74,9 +70,9 @@ public List getEmails2() throws IOException {
}
/**
- * Returns the read-only list of all the pulic keys of the current user.
+ * Returns the read-only list of all the public keys of the current user.
*
- * NOTE: When using OAuth authenticaiton, the READ/WRITE User scope is required by the GitHub APIs, otherwise you
+ * NOTE: When using OAuth authentication, the READ/WRITE User scope is required by the GitHub APIs, otherwise you
* will get a 404 NOT FOUND.
*
* @return Always non-null.
@@ -87,6 +83,28 @@ public List getPublicKeys() throws IOException {
return root().createRequest().withUrlPath("/user/keys").toIterable(GHKey[].class, null).toList();
}
+ /**
+ * Add public SSH key for the user.
+ *
+ * https://docs.github.com/en/rest/users/keys?apiVersion=2022-11-28#create-a-public-ssh-key-for-the-authenticated-user
+ *
+ * @param title
+ * Title of the SSH key
+ * @param key
+ * the public key
+ * @return the newly created Github key
+ * @throws IOException
+ * the io exception
+ */
+ public GHKey addPublicKey(String title, String key) throws IOException {
+ return root().createRequest()
+ .withUrlPath("/user/keys")
+ .method("POST")
+ .with("title", title)
+ .with("key", key)
+ .fetch(GHKey.class);
+ }
+
/**
* Returns the read-only list of all the public verified keys of the current user.
*
@@ -144,6 +162,8 @@ public synchronized Map getAllRepositories() throws IOExce
*
* Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned. Repositories
* are returned by GitHub API with a 30 items per page.
+ *
+ * @return the paged iterable
*/
@Override
public PagedIterable listRepositories() {
@@ -162,6 +182,7 @@ public PagedIterable listRepositories() {
* size for each page of items returned by GitHub. Maximum page size is 100.
*
* Unlike {@link #getRepositories()}, this does not wait until all the repositories are returned.
+ * @return the paged iterable
*/
public PagedIterable listRepositories(final int pageSize) {
return listRepositories(pageSize, RepositoryListFilter.ALL);
@@ -197,7 +218,7 @@ public PagedIterable listAllRepositories() {
}
/**
- * List your organization memberships
+ * List your organization memberships.
*
* @return the paged iterable
*/
@@ -206,7 +227,7 @@ public PagedIterable listOrgMemberships() {
}
/**
- * List your organization memberships
+ * List your organization memberships.
*
* @param state
* Filter by a specific state
diff --git a/src/main/java/org/kohsuke/github/GHNotificationStream.java b/src/main/java/org/kohsuke/github/GHNotificationStream.java
index 4c545354c2..7e62d7b6c6 100644
--- a/src/main/java/org/kohsuke/github/GHNotificationStream.java
+++ b/src/main/java/org/kohsuke/github/GHNotificationStream.java
@@ -5,6 +5,7 @@
import java.util.Iterator;
import java.util.NoSuchElementException;
+// TODO: Auto-generated Javadoc
/**
* Listens to GitHub notification stream.
*
@@ -29,13 +30,21 @@ public class GHNotificationStream extends GitHubInteractiveObject implements Ite
private String apiUrl;
private boolean nonBlocking = false;
+ /**
+ * Instantiates a new GH notification stream.
+ *
+ * @param root
+ * the root
+ * @param apiUrl
+ * the api url
+ */
GHNotificationStream(GitHub root, String apiUrl) {
super(root);
this.apiUrl = apiUrl;
}
/**
- * Should the stream include notifications that are already read?
+ * Should the stream include notifications that are already read?.
*
* @param v
* the v
@@ -47,7 +56,7 @@ public GHNotificationStream read(boolean v) {
}
/**
- * Should the stream be restricted to notifications in which the user is directly participating or mentioned?
+ * Should the stream be restricted to notifications in which the user is directly participating or mentioned?.
*
* @param v
* the v
@@ -96,6 +105,8 @@ public GHNotificationStream nonBlocking(boolean v) {
/**
* Returns an infinite blocking {@link Iterator} that returns {@link GHThread} as notifications arrive.
+ *
+ * @return the iterator
*/
public Iterator iterator() {
// capture the configuration setting here
diff --git a/src/main/java/org/kohsuke/github/GHOTPRequiredException.java b/src/main/java/org/kohsuke/github/GHOTPRequiredException.java
index 64e95e3cc9..b577d37846 100644
--- a/src/main/java/org/kohsuke/github/GHOTPRequiredException.java
+++ b/src/main/java/org/kohsuke/github/GHOTPRequiredException.java
@@ -1,7 +1,7 @@
package org.kohsuke.github;
/**
- * This exception is thrown when GitHub is requesting an OTP from the user
+ * This exception is thrown when GitHub is requesting an OTP from the user.
*
* @author Kevin Harrington mad.hephaestus@gmail.com
*/
diff --git a/src/main/java/org/kohsuke/github/GHObject.java b/src/main/java/org/kohsuke/github/GHObject.java
index 7d89cd36db..e58c2144a1 100644
--- a/src/main/java/org/kohsuke/github/GHObject.java
+++ b/src/main/java/org/kohsuke/github/GHObject.java
@@ -16,6 +16,7 @@
import javax.annotation.CheckForNull;
+// TODO: Auto-generated Javadoc
/**
* Most (all?) domain objects in GitHub seems to have these 4 properties.
*/
@@ -34,11 +35,14 @@ public abstract class GHObject extends GitHubInteractiveObject {
private String createdAt;
private String updatedAt;
+ /**
+ * Instantiates a new GH object.
+ */
GHObject() {
}
/**
- * Called by Jackson
+ * Called by Jackson.
*
* @param connectorResponse
* the {@link GitHubConnectorResponse} to get headers from.
@@ -69,7 +73,7 @@ public Map> getResponseHeaderFields() {
}
/**
- * When was this resource created?
+ * When was this resource created?.
*
* @return date created
* @throws IOException
@@ -106,7 +110,7 @@ public URL getUrl() {
public abstract URL getHtmlUrl() throws IOException;
/**
- * When was this resource last updated?
+ * When was this resource last updated?.
*
* @return updated date
* @throws IOException
@@ -119,9 +123,8 @@ public Date getUpdatedAt() throws IOException {
/**
* Get Global node_id from Github object.
*
- * @see Using Global Node IDs
- *
* @return Global Node ID.
+ * @see Using Global Node IDs
*/
public String getNodeId() {
return nodeId;
@@ -154,6 +157,8 @@ private Object urlToString(URL url, Class type) {
/**
* String representation to assist debugging and inspection. The output format of this string is not a committed
* part of the API and is subject to change.
+ *
+ * @return the string
*/
@Override
public String toString() {
diff --git a/src/main/java/org/kohsuke/github/GHOrgHook.java b/src/main/java/org/kohsuke/github/GHOrgHook.java
index 931002d119..485e1c47a4 100644
--- a/src/main/java/org/kohsuke/github/GHOrgHook.java
+++ b/src/main/java/org/kohsuke/github/GHOrgHook.java
@@ -4,22 +4,43 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GHOrgHook.
+ */
class GHOrgHook extends GHHook {
/**
* Organization that the hook belongs to.
*/
transient GHOrganization organization;
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH org hook
+ */
GHOrgHook wrap(GHOrganization owner) {
this.organization = owner;
return this;
}
+ /**
+ * Root.
+ *
+ * @return the git hub
+ */
@Override
GitHub root() {
return organization.root();
}
+ /**
+ * Gets the api route.
+ *
+ * @return the api route
+ */
@Override
String getApiRoute() {
return String.format("/orgs/%s/hooks/%d", organization.getLogin(), getId());
diff --git a/src/main/java/org/kohsuke/github/GHOrganization.java b/src/main/java/org/kohsuke/github/GHOrganization.java
index 90d0bba0c9..0d881aff61 100644
--- a/src/main/java/org/kohsuke/github/GHOrganization.java
+++ b/src/main/java/org/kohsuke/github/GHOrganization.java
@@ -12,6 +12,7 @@
import static org.kohsuke.github.internal.Previews.INERTIA;
+// TODO: Auto-generated Javadoc
/**
* The type GHOrganization.
*
@@ -159,7 +160,7 @@ public GHTeam getTeam(long teamId) throws IOException {
}
/**
- * Finds a team that has the given name in its {@link GHTeam#getName()}
+ * Finds a team that has the given name in its {@link GHTeam#getName()}.
*
* @param name
* the name
@@ -176,7 +177,7 @@ public GHTeam getTeamByName(String name) throws IOException {
}
/**
- * Finds a team that has the given slug in its {@link GHTeam#getSlug()}
+ * Finds a team that has the given slug in its {@link GHTeam#getSlug()}.
*
* @param slug
* the slug
@@ -193,9 +194,11 @@ public GHTeam getTeamBySlug(String slug) throws IOException {
}
/**
- * Member's role in an organization
+ * Member's role in an organization.
*/
public enum Role {
+
+ /** The admin. */
ADMIN,
/** The user is an owner of the organization. */
MEMBER /** The user is a non-owner member of the organization. */
@@ -312,6 +315,17 @@ public PagedIterable listPublicMembers() throws IOException {
return listMembers("public_members");
}
+ /**
+ * All the outside collaborators of this organization.
+ *
+ * @return the paged iterable
+ * @throws IOException
+ * the io exception
+ */
+ public PagedIterable listOutsideCollaborators() throws IOException {
+ return listMembers("outside_collaborators");
+ }
+
private PagedIterable listMembers(String suffix) throws IOException {
return listMembers(suffix, null, null);
}
@@ -329,6 +343,19 @@ public PagedIterable listMembersWithFilter(String filter) throws IOExcep
return listMembers("members", filter, null);
}
+ /**
+ * List outside collaborators with filter paged iterable.
+ *
+ * @param filter
+ * the filter
+ * @return the paged iterable
+ * @throws IOException
+ * the io exception
+ */
+ public PagedIterable listOutsideCollaboratorsWithFilter(String filter) throws IOException {
+ return listMembers("outside_collaborators", filter, null);
+ }
+
/**
* List members with specified role paged iterable.
*
@@ -376,7 +403,7 @@ public boolean areOrganizationProjectsEnabled() {
}
/**
- * Sets organization projects enabled status boolean
+ * Sets organization projects enabled status boolean.
*
* @param newStatus
* enable status
@@ -450,7 +477,17 @@ public GHProject createProject(String name, String body) throws IOException {
* @see RepositoryRole
*/
public enum Permission {
- ADMIN, MAINTAIN, PUSH, TRIAGE, PULL
+
+ /** The admin. */
+ ADMIN,
+ /** The maintain. */
+ MAINTAIN,
+ /** The push. */
+ PUSH,
+ /** The triage. */
+ TRIAGE,
+ /** The pull. */
+ PULL
}
/**
@@ -463,14 +500,33 @@ private RepositoryRole(String permission) {
this.permission = permission;
}
+ /**
+ * Custom.
+ *
+ * @param permission
+ * the permission
+ * @return the repository role
+ */
public static RepositoryRole custom(String permission) {
return new RepositoryRole(permission);
}
+ /**
+ * From.
+ *
+ * @param permission
+ * the permission
+ * @return the repository role
+ */
public static RepositoryRole from(Permission permission) {
return custom(permission.toString().toLowerCase());
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return permission;
@@ -599,7 +655,7 @@ public List getRepositoriesWithOpenPullRequests() throws IOExcepti
}
/**
- * Gets all the open pull requests in this organizataion.
+ * Gets all the open pull requests in this organization.
*
* @return the pull requests
* @throws IOException
@@ -615,6 +671,10 @@ public List getPullRequests() throws IOException {
/**
* Lists events performed by a user (this includes private events if the caller is authenticated.
+ *
+ * @return the paged iterable
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
public PagedIterable listEvents() throws IOException {
return root().createRequest()
@@ -628,6 +688,7 @@ public PagedIterable listEvents() throws IOException {
* @param pageSize
* size for each page of items returned by GitHub. Maximum page size is 100. Unlike
* {@link #getRepositories()}, this does not wait until all the repositories are returned.
+ * @return the paged iterable
*/
@Override
public PagedIterable listRepositories(final int pageSize) {
diff --git a/src/main/java/org/kohsuke/github/GHPermission.java b/src/main/java/org/kohsuke/github/GHPermission.java
index c15a9d54ea..ec8613182b 100644
--- a/src/main/java/org/kohsuke/github/GHPermission.java
+++ b/src/main/java/org/kohsuke/github/GHPermission.java
@@ -26,6 +26,7 @@
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* Permission for a user in a repository.
*
diff --git a/src/main/java/org/kohsuke/github/GHPermissionType.java b/src/main/java/org/kohsuke/github/GHPermissionType.java
index 7b0952817b..2414c5d2a4 100644
--- a/src/main/java/org/kohsuke/github/GHPermissionType.java
+++ b/src/main/java/org/kohsuke/github/GHPermissionType.java
@@ -1,19 +1,41 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* The enum GHPermissionType.
*
* @author Kohsuke Kawaguchi
*/
public enum GHPermissionType {
- ADMIN(30), WRITE(20), READ(10), NONE(0);
+
+ /** The admin. */
+ ADMIN(30),
+ /** The write. */
+ WRITE(20),
+ /** The read. */
+ READ(10),
+ /** The none. */
+ NONE(0);
private final int level;
+ /**
+ * Instantiates a new GH permission type.
+ *
+ * @param level
+ * the level
+ */
GHPermissionType(int level) {
this.level = level;
}
+ /**
+ * Implies.
+ *
+ * @param other
+ * the other
+ * @return true, if successful
+ */
boolean implies(GHPermissionType other) {
// NONE is a special case
if (other == NONE) {
diff --git a/src/main/java/org/kohsuke/github/GHPerson.java b/src/main/java/org/kohsuke/github/GHPerson.java
index 4e75b80667..addcebfead 100644
--- a/src/main/java/org/kohsuke/github/GHPerson.java
+++ b/src/main/java/org/kohsuke/github/GHPerson.java
@@ -11,6 +11,7 @@
import java.util.Optional;
import java.util.TreeMap;
+// TODO: Auto-generated Javadoc
/**
* Common part of {@link GHUser} and {@link GHOrganization}.
*
@@ -18,15 +19,24 @@
*/
public abstract class GHPerson extends GHObject {
+ /** The avatar url. */
// core data fields that exist even for "small" user data (such as the user info in pull request)
protected String login, avatar_url;
+ /** The twitter username. */
// other fields (that only show up in full data)
protected String location, blog, email, bio, name, company, type, twitter_username;
+
+ /** The html url. */
protected String html_url;
+
+ /** The public gists. */
protected int followers, following, public_repos, public_gists;
+
+ /** The hireable. */
protected boolean site_admin, hireable;
+ /** The total private repos. */
// other fields (that only show up in full data) that require privileged scope
protected Integer total_private_repos;
@@ -159,7 +169,7 @@ public GHRepository getRepository(String name) throws IOException {
public abstract PagedIterable listEvents() throws IOException;
/**
- * Gravatar ID of this user, like 0cb9832a01c22c083390f3c5dcb64105
+ * Gravatar ID of this user, like 0cb9832a01c22c083390f3c5dcb64105.
*
* @return the gravatar id
* @deprecated No longer available in the v3 API.
@@ -179,7 +189,7 @@ public String getAvatarUrl() {
}
/**
- * Gets the login ID of this user, like 'kohsuke'
+ * Gets the login ID of this user, like 'kohsuke'.
*
* @return the login
*/
@@ -188,7 +198,7 @@ public String getLogin() {
}
/**
- * Gets the human-readable name of the user, like "Kohsuke Kawaguchi"
+ * Gets the human-readable name of the user, like "Kohsuke Kawaguchi".
*
* @return the name
* @throws IOException
@@ -212,7 +222,7 @@ public String getCompany() throws IOException {
}
/**
- * Gets the location of this user, like "Santa Clara, California"
+ * Gets the location of this user, like "Santa Clara, California".
*
* @return the location
* @throws IOException
@@ -224,7 +234,7 @@ public String getLocation() throws IOException {
}
/**
- * Gets the Twitter Username of this user, like "GitHub"
+ * Gets the Twitter Username of this user, like "GitHub".
*
* @return the Twitter username
* @throws IOException
@@ -235,11 +245,25 @@ public String getTwitterUsername() throws IOException {
return twitter_username;
}
+ /**
+ * Gets the created at.
+ *
+ * @return the created at
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public Date getCreatedAt() throws IOException {
populate();
return super.getCreatedAt();
}
+ /**
+ * Gets the updated at.
+ *
+ * @return the updated at
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public Date getUpdatedAt() throws IOException {
populate();
return super.getUpdatedAt();
@@ -257,6 +281,11 @@ public String getBlog() throws IOException {
return blog;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
@@ -335,7 +364,7 @@ public String getType() throws IOException {
}
/**
- * Gets the site_admin field
+ * Gets the site_admin field.
*
* @return the site_admin field
* @throws IOException
diff --git a/src/main/java/org/kohsuke/github/GHPersonSet.java b/src/main/java/org/kohsuke/github/GHPersonSet.java
index f0cc5d77ab..c737249b5e 100644
--- a/src/main/java/org/kohsuke/github/GHPersonSet.java
+++ b/src/main/java/org/kohsuke/github/GHPersonSet.java
@@ -4,12 +4,13 @@
import java.util.Collection;
import java.util.HashSet;
+// TODO: Auto-generated Javadoc
/**
* Set of {@link GHPerson} with helper lookup methods.
*
+ * @author Kohsuke Kawaguchi
* @param
* the type parameter
- * @author Kohsuke Kawaguchi
*/
public class GHPersonSet extends HashSet {
private static final long serialVersionUID = 1L;
diff --git a/src/main/java/org/kohsuke/github/GHProject.java b/src/main/java/org/kohsuke/github/GHProject.java
index 1a0f963ac8..8e89001298 100644
--- a/src/main/java/org/kohsuke/github/GHProject.java
+++ b/src/main/java/org/kohsuke/github/GHProject.java
@@ -32,6 +32,7 @@
import static org.kohsuke.github.internal.Previews.INERTIA;
+// TODO: Auto-generated Javadoc
/**
* A GitHub project.
*
@@ -39,6 +40,8 @@
* @see Projects
*/
public class GHProject extends GHObject {
+
+ /** The owner. */
protected GHObject owner;
private String owner_url;
@@ -49,6 +52,13 @@ public class GHProject extends GHObject {
private String state;
private GHUser creator;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
return GitHubClient.parseURL(html_url);
@@ -92,8 +102,8 @@ public URL getOwnerUrl() {
/**
* Gets node id.
*
- * @deprecated Use {@link GHObject#getNodeId()}
* @return the node id
+ * @deprecated Use {@link GHObject#getNodeId()}
*/
@Deprecated
public String getNode_id() {
@@ -223,7 +233,11 @@ public void setBody(String body) throws IOException {
* The enum ProjectState.
*/
public enum ProjectState {
- OPEN, CLOSED
+
+ /** The open. */
+ OPEN,
+ /** The closed. */
+ CLOSED
}
/**
@@ -242,7 +256,13 @@ public void setState(ProjectState state) throws IOException {
* The enum ProjectStateFilter.
*/
public static enum ProjectStateFilter {
- ALL, OPEN, CLOSED
+
+ /** The all. */
+ ALL,
+ /** The open. */
+ OPEN,
+ /** The closed. */
+ CLOSED
}
/**
diff --git a/src/main/java/org/kohsuke/github/GHProjectCard.java b/src/main/java/org/kohsuke/github/GHProjectCard.java
index 27cd2b95a6..9cb0f92f2f 100644
--- a/src/main/java/org/kohsuke/github/GHProjectCard.java
+++ b/src/main/java/org/kohsuke/github/GHProjectCard.java
@@ -9,6 +9,7 @@
import static org.kohsuke.github.internal.Previews.INERTIA;
+// TODO: Auto-generated Javadoc
/**
* The type GHProjectCard.
*
@@ -23,6 +24,13 @@ public class GHProjectCard extends GHObject {
private String content_url, project_url, column_url;
private boolean archived;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public URL getHtmlUrl() throws IOException {
return null;
}
diff --git a/src/main/java/org/kohsuke/github/GHProjectColumn.java b/src/main/java/org/kohsuke/github/GHProjectColumn.java
index 70dd63f5ad..024e9a876f 100644
--- a/src/main/java/org/kohsuke/github/GHProjectColumn.java
+++ b/src/main/java/org/kohsuke/github/GHProjectColumn.java
@@ -8,17 +8,27 @@
import static org.kohsuke.github.internal.Previews.INERTIA;
+// TODO: Auto-generated Javadoc
/**
* The type GHProjectColumn.
*
* @author Gunnar Skjold
*/
public class GHProjectColumn extends GHObject {
+
+ /** The project. */
protected GHProject project;
private String name;
private String project_url;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
return null;
diff --git a/src/main/java/org/kohsuke/github/GHProjectsV2Item.java b/src/main/java/org/kohsuke/github/GHProjectsV2Item.java
new file mode 100644
index 0000000000..ea6c7006b6
--- /dev/null
+++ b/src/main/java/org/kohsuke/github/GHProjectsV2Item.java
@@ -0,0 +1,103 @@
+package org.kohsuke.github;
+
+import org.kohsuke.github.internal.EnumUtils;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Date;
+
+// TODO: Auto-generated Javadoc
+/**
+ * A Projects V2 item in the organization.
+ *
+ * Projects V2 are not attached to a repository but to an organization, even if it is possible to create shortcuts at
+ * the repository level.
+ *
+ * This event exposes the GraphQL object (more or less - the ids are handled differently for instance) directly. The new
+ * Projects V2 API is only available through GraphQL so for now you cannot execute any actions on this object.
+ *
+ * @author Guillaume Smet
+ * @see The
+ * GraphQL API for Projects V2
+ */
+public class GHProjectsV2Item extends GHObject {
+
+ private String projectNodeId;
+ private String contentNodeId;
+ private String contentType;
+
+ private GHUser creator;
+ private String archivedAt;
+
+ /**
+ * Gets the project node id.
+ *
+ * @return the project node id
+ */
+ public String getProjectNodeId() {
+ return projectNodeId;
+ }
+
+ /**
+ * Gets the content node id.
+ *
+ * @return the content node id
+ */
+ public String getContentNodeId() {
+ return contentNodeId;
+ }
+
+ /**
+ * Gets the content type.
+ *
+ * @return the content type
+ */
+ public ContentType getContentType() {
+ return EnumUtils.getEnumOrDefault(ContentType.class, contentType, ContentType.UNKNOWN);
+ }
+
+ /**
+ * Gets the creator.
+ *
+ * @return the creator
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
+ public GHUser getCreator() throws IOException {
+ return root().intern(creator);
+ }
+
+ /**
+ * Gets the archived at.
+ *
+ * @return the archived at
+ */
+ public Date getArchivedAt() {
+ return GitHubClient.parseDate(archivedAt);
+ }
+
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
+ public URL getHtmlUrl() {
+ throw new IllegalStateException(getClass().getName() + " does not offer a HTML URL.");
+ }
+
+ /**
+ * The Enum ContentType.
+ */
+ public enum ContentType {
+
+ /** The issue. */
+ ISSUE,
+ /** The draftissue. */
+ DRAFTISSUE,
+ /** The pullrequest. */
+ PULLREQUEST,
+ /** The unknown. */
+ UNKNOWN;
+ }
+}
diff --git a/src/main/java/org/kohsuke/github/GHProjectsV2ItemChanges.java b/src/main/java/org/kohsuke/github/GHProjectsV2ItemChanges.java
new file mode 100644
index 0000000000..2e96fa4c2d
--- /dev/null
+++ b/src/main/java/org/kohsuke/github/GHProjectsV2ItemChanges.java
@@ -0,0 +1,149 @@
+package org.kohsuke.github;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.kohsuke.github.internal.EnumUtils;
+
+import java.util.Date;
+
+// TODO: Auto-generated Javadoc
+/**
+ * An object to track changes in projects_v2_item payloads.
+ *
+ * Note that this is best effort only as nothing is documented in the GitHub documentation.
+ */
+@SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD" }, justification = "JSON API")
+public class GHProjectsV2ItemChanges {
+
+ private FieldValue fieldValue;
+
+ private FromToDate archivedAt;
+
+ private FromTo previousProjectsV2ItemNodeId;
+
+ /**
+ * Gets the field value.
+ *
+ * @return the field value
+ */
+ public FieldValue getFieldValue() {
+ return fieldValue;
+ }
+
+ /**
+ * Gets the archived at.
+ *
+ * @return the archived at
+ */
+ public FromToDate getArchivedAt() {
+ return archivedAt;
+ }
+
+ /**
+ * Gets the previous projects V 2 item node id.
+ *
+ * @return the previous projects V 2 item node id
+ */
+ public FromTo getPreviousProjectsV2ItemNodeId() {
+ return previousProjectsV2ItemNodeId;
+ }
+
+ /**
+ * The Class FieldValue.
+ */
+ public static class FieldValue {
+
+ private String fieldNodeId;
+ private String fieldType;
+
+ /**
+ * Gets the field node id.
+ *
+ * @return the field node id
+ */
+ public String getFieldNodeId() {
+ return fieldNodeId;
+ }
+
+ /**
+ * Gets the field type.
+ *
+ * @return the field type
+ */
+ public FieldType getFieldType() {
+ return EnumUtils.getEnumOrDefault(FieldType.class, fieldType, FieldType.UNKNOWN);
+ }
+ }
+
+ /**
+ * The Class FromTo.
+ */
+ public static class FromTo {
+
+ private String from;
+ private String to;
+
+ /**
+ * Gets the from.
+ *
+ * @return the from
+ */
+ public String getFrom() {
+ return from;
+ }
+
+ /**
+ * Gets the to.
+ *
+ * @return the to
+ */
+ public String getTo() {
+ return to;
+ }
+ }
+
+ /**
+ * The Class FromToDate.
+ */
+ public static class FromToDate {
+
+ private String from;
+ private String to;
+
+ /**
+ * Gets the from.
+ *
+ * @return the from
+ */
+ public Date getFrom() {
+ return GitHubClient.parseDate(from);
+ }
+
+ /**
+ * Gets the to.
+ *
+ * @return the to
+ */
+ public Date getTo() {
+ return GitHubClient.parseDate(to);
+ }
+ }
+
+ /**
+ * The Enum FieldType.
+ */
+ public enum FieldType {
+
+ /** The text. */
+ TEXT,
+ /** The number. */
+ NUMBER,
+ /** The date. */
+ DATE,
+ /** The single select. */
+ SINGLE_SELECT,
+ /** The iteration. */
+ ITERATION,
+ /** The unknown. */
+ UNKNOWN;
+ }
+}
diff --git a/src/main/java/org/kohsuke/github/GHPullRequest.java b/src/main/java/org/kohsuke/github/GHPullRequest.java
index c476784c53..894c146497 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequest.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequest.java
@@ -40,6 +40,7 @@
import static org.kohsuke.github.internal.Previews.LYDIAN;
import static org.kohsuke.github.internal.Previews.SHADOW_CAT;
+// TODO: Auto-generated Javadoc
/**
* A pull request.
*
@@ -61,6 +62,8 @@ public class GHPullRequest extends GHIssue implements Refreshable {
private GHUser merged_by;
private int review_comments, additions, commits;
private boolean merged, maintainer_can_modify;
+
+ /** The draft. */
// making these package private to all for testing
boolean draft;
private Boolean mergeable;
@@ -75,11 +78,23 @@ public class GHPullRequest extends GHIssue implements Refreshable {
private GHUser[] requested_reviewers;
private GHTeam[] requested_teams;
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH pull request
+ */
GHPullRequest wrapUp(GHRepository owner) {
this.wrap(owner);
return this;
}
+ /**
+ * Gets the api route.
+ *
+ * @return the api route
+ */
@Override
protected String getApiRoute() {
if (owner == null) {
@@ -165,11 +180,21 @@ public Date getMergedAt() {
return GitHubClient.parseDate(merged_at);
}
+ /**
+ * Gets the closed by.
+ *
+ * @return the closed by
+ */
@Override
public GHUser getClosedBy() {
return null;
}
+ /**
+ * Gets the pull request.
+ *
+ * @return the pull request
+ */
@Override
public PullRequest getPullRequest() {
return null;
@@ -265,7 +290,7 @@ public boolean isDraft() throws IOException {
}
/**
- * Is this PR mergeable?
+ * Is this PR mergeable?.
*
* @return null if the state has not been determined yet, for example when a PR is newly created. If this method is
* called on an instance whose mergeable state is not yet known, API call is made to retrieve the latest
@@ -278,7 +303,13 @@ public Boolean getMergeable() throws IOException {
return mergeable;
}
- /** for test purposes only */
+ /**
+ * for test purposes only.
+ *
+ * @return the mergeable no refresh
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Deprecated
Boolean getMergeableNoRefresh() throws IOException {
return mergeable;
@@ -368,7 +399,12 @@ private void populate() throws IOException {
refresh();
}
- /** Repopulates this object. */
+ /**
+ * Repopulates this object.
+ *
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public void refresh() throws IOException {
if (isOffline()) {
return; // cannot populate, will have to live with what we have
@@ -549,13 +585,13 @@ public void requestTeamReviewers(List teams) throws IOException {
}
/**
- * Set the base branch on the pull request
+ * Set the base branch on the pull request.
*
* @param newBaseBranch
* the name of the new base branch
+ * @return the updated pull request
* @throws IOException
* the io exception
- * @return the updated pull request
*/
public GHPullRequest setBaseBranch(String newBaseBranch) throws IOException {
return root().createRequest()
@@ -640,7 +676,13 @@ public void merge(String msg, String sha, MergeMethod method) throws IOException
/** The enum MergeMethod. */
public enum MergeMethod {
- MERGE, SQUASH, REBASE
+
+ /** The merge. */
+ MERGE,
+ /** The squash. */
+ SQUASH,
+ /** The rebase. */
+ REBASE
}
/**
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestChanges.java b/src/main/java/org/kohsuke/github/GHPullRequestChanges.java
index 616d749d13..24dde41a0f 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestChanges.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestChanges.java
@@ -2,8 +2,9 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
- * Wrapper to define changed fields on pull_request action="edited"
+ * Wrapper to define changed fields on pull_request action="edited".
*
* @see GHEventPayload.PullRequest
*/
@@ -42,6 +43,8 @@ public GHFrom getBody() {
}
/**
+ * The Class GHCommitPointer.
+ *
* @see org.kohsuke.github.GHCommitPointer
*/
public static class GHCommitPointer {
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java b/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java
index 5649126ca8..c3faccbfad 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestCommitDetail.java
@@ -28,6 +28,7 @@
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
* Commit detail inside a {@link GHPullRequest}.
*
@@ -41,6 +42,12 @@
public class GHPullRequestCommitDetail {
private GHPullRequest owner;
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ */
void wrapUp(GHPullRequest owner) {
this.owner = owner;
}
@@ -57,7 +64,11 @@ public static class Authorship extends GitUser {
* The type Tree.
*/
public static class Tree {
+
+ /** The sha. */
String sha;
+
+ /** The url. */
String url;
/**
@@ -83,11 +94,23 @@ public URL getUrl() {
* The type Commit.
*/
public static class Commit {
+
+ /** The author. */
Authorship author;
+
+ /** The committer. */
Authorship committer;
+
+ /** The message. */
String message;
+
+ /** The tree. */
Tree tree;
+
+ /** The url. */
String url;
+
+ /** The comment count. */
int comment_count;
/**
@@ -151,8 +174,14 @@ public Tree getTree() {
* The type CommitPointer.
*/
public static class CommitPointer {
+
+ /** The sha. */
String sha;
+
+ /** The url. */
String url;
+
+ /** The html url. */
String html_url;
/**
@@ -183,11 +212,22 @@ public String getSha() {
}
}
+ /** The sha. */
String sha;
+
+ /** The commit. */
Commit commit;
+
+ /** The url. */
String url;
+
+ /** The html url. */
String html_url;
+
+ /** The comments url. */
String comments_url;
+
+ /** The parents. */
CommitPointer[] parents;
/**
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java b/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java
index 358ea8c38c..ba6e89d323 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestFileDetail.java
@@ -25,6 +25,7 @@
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
* File detail inside a {@link GHPullRequest}.
*
@@ -34,25 +35,45 @@
*/
public class GHPullRequestFileDetail {
+ /** The sha. */
String sha;
+
+ /** The filename. */
String filename;
+
+ /** The status. */
String status;
+
+ /** The additions. */
int additions;
+
+ /** The deletions. */
int deletions;
+
+ /** The changes. */
int changes;
+
+ /** The blob url. */
String blob_url;
+
+ /** The raw url. */
String raw_url;
+
+ /** The contents url. */
String contents_url;
+
+ /** The patch. */
String patch;
+
+ /** The previous filename. */
String previous_filename;
/**
* Gets sha of the file (not commit sha).
*
+ * @return the sha
* @see List pull requests
* files
- *
- * @return the sha
*/
public String getSha() {
return sha;
@@ -68,7 +89,7 @@ public String getFilename() {
}
/**
- * Gets status (added/modified/deleted)
+ * Gets status (added/modified/deleted).
*
* @return the status
*/
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java b/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java
index 8136b1dadf..eb93f200b0 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestQueryBuilder.java
@@ -2,6 +2,7 @@
import static org.kohsuke.github.internal.Previews.SHADOW_CAT;
+// TODO: Auto-generated Javadoc
/**
* Lists up pull requests with some filtering and sorting.
*
@@ -11,6 +12,12 @@
public class GHPullRequestQueryBuilder extends GHQueryBuilder {
private final GHRepository repo;
+ /**
+ * Instantiates a new GH pull request query builder.
+ *
+ * @param repo
+ * the repo
+ */
GHPullRequestQueryBuilder(GHRepository repo) {
super(repo.root());
this.repo = repo;
@@ -71,7 +78,15 @@ public GHPullRequestQueryBuilder sort(Sort sort) {
* The enum Sort.
*/
public enum Sort {
- CREATED, UPDATED, POPULARITY, LONG_RUNNING
+
+ /** The created. */
+ CREATED,
+ /** The updated. */
+ UPDATED,
+ /** The popularity. */
+ POPULARITY,
+ /** The long running. */
+ LONG_RUNNING
}
/**
@@ -86,6 +101,11 @@ public GHPullRequestQueryBuilder direction(GHDirection d) {
return this;
}
+ /**
+ * List.
+ *
+ * @return the paged iterable
+ */
@Override
public PagedIterable list() {
return req.withPreview(SHADOW_CAT)
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReview.java b/src/main/java/org/kohsuke/github/GHPullRequestReview.java
index 17089e0376..a72f462f1e 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestReview.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestReview.java
@@ -31,6 +31,7 @@
import javax.annotation.CheckForNull;
+// TODO: Auto-generated Javadoc
/**
* Review to a pull request.
*
@@ -39,6 +40,8 @@
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD" }, justification = "JSON API")
public class GHPullRequestReview extends GHObject {
+
+ /** The owner. */
GHPullRequest owner;
private String body;
@@ -48,6 +51,13 @@ public class GHPullRequestReview extends GHObject {
private String submitted_at;
private String html_url;
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH pull request review
+ */
GHPullRequestReview wrapUp(GHPullRequest owner) {
this.owner = owner;
return this;
@@ -105,6 +115,11 @@ public GHPullRequestReviewState getState() {
return state;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
@@ -120,7 +135,7 @@ protected String getApiRoute() {
}
/**
- * When was this resource created?
+ * When was this resource created?.
*
* @return the submitted at
* @throws IOException
@@ -132,6 +147,10 @@ public Date getSubmittedAt() throws IOException {
/**
* Since this method does not exist, we forward this value.
+ *
+ * @return the created at
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
@Override
public Date getCreatedAt() throws IOException {
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java
index 91a07a4490..fefcf0b4ca 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewBuilder.java
@@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* Builds up a creation of new {@link GHPullRequestReview}.
*
@@ -15,6 +16,12 @@ public class GHPullRequestReviewBuilder {
private final Requester builder;
private final List comments = new ArrayList();
+ /**
+ * Instantiates a new GH pull request review builder.
+ *
+ * @param pr
+ * the pr
+ */
GHPullRequestReviewBuilder(GHPullRequest pr) {
this.pr = pr;
this.builder = pr.root().createRequest();
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java
index bb88d9f6d7..dabb063906 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java
@@ -33,8 +33,9 @@
import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
+// TODO: Auto-generated Javadoc
/**
- * Review comment to the pull request
+ * Review comment to the pull request.
*
* @author Julien Henry
* @see GHPullRequest#listReviewComments() GHPullRequest#listReviewComments()
@@ -42,6 +43,8 @@
* String, int)
*/
public class GHPullRequestReviewComment extends GHObject implements Reactable {
+
+ /** The owner. */
GHPullRequest owner;
private Long pull_request_review_id = -1L;
@@ -88,6 +91,13 @@ public static GHPullRequestReviewComment draft(String body, String path, int pos
return result;
}
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH pull request review comment
+ */
GHPullRequestReviewComment wrapUp(GHPullRequest owner) {
this.owner = owner;
return this;
@@ -197,6 +207,11 @@ public long getInReplyToId() {
return in_reply_to_id;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
@@ -375,6 +390,15 @@ public GHPullRequestReviewComment reply(String body) throws IOException {
.wrapUp(owner);
}
+ /**
+ * Creates the reaction.
+ *
+ * @param content
+ * the content
+ * @return the GH reaction
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Preview(SQUIRREL_GIRL)
public GHReaction createReaction(ReactionContent content) throws IOException {
return owner.root()
@@ -386,6 +410,14 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
.fetch(GHReaction.class);
}
+ /**
+ * Delete reaction.
+ *
+ * @param reaction
+ * the reaction
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public void deleteReaction(GHReaction reaction) throws IOException {
owner.root()
.createRequest()
@@ -394,6 +426,11 @@ public void deleteReaction(GHReaction reaction) throws IOException {
.send();
}
+ /**
+ * List reactions.
+ *
+ * @return the paged iterable
+ */
@Preview(SQUIRREL_GIRL)
public PagedIterable listReactions() {
return owner.root()
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java
index 0d4e681c38..025de45cad 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewEvent.java
@@ -23,18 +23,34 @@
*/
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Action to perform on {@link GHPullRequestReview}.
*/
public enum GHPullRequestReviewEvent {
- PENDING, APPROVE, REQUEST_CHANGES, COMMENT;
+ /** The pending. */
+ PENDING,
+ /** The approve. */
+ APPROVE,
+ /** The request changes. */
+ REQUEST_CHANGES,
+ /** The comment. */
+ COMMENT;
+
+ /**
+ * Action.
+ *
+ * @return the string
+ */
String action() {
return this == PENDING ? null : name();
}
/**
* When a {@link GHPullRequestReview} is submitted with this event, it should transition to this state.
+ *
+ * @return the GH pull request review state
*/
GHPullRequestReviewState toState() {
switch (this) {
diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java
index 3055cff233..27026f4783 100644
--- a/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java
+++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewState.java
@@ -1,18 +1,32 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
- * Current state of {@link GHPullRequestReview}
+ * Current state of {@link GHPullRequestReview}.
*/
public enum GHPullRequestReviewState {
+
+ /** The pending. */
PENDING,
+
+ /** The approved. */
APPROVED,
+
+ /** The changes requested. */
CHANGES_REQUESTED,
+
/**
+ * The request changes.
+ *
* @deprecated This was the thing when this API was in preview, but it changed when it became public. Use
* {@link #CHANGES_REQUESTED}. Left here for compatibility.
*/
REQUEST_CHANGES,
+
+ /** The commented. */
COMMENTED,
+
+ /** The dismissed. */
DISMISSED;
/**
@@ -26,6 +40,11 @@ public String action() {
return e == null ? null : e.action();
}
+ /**
+ * To event.
+ *
+ * @return the GH pull request review event
+ */
GHPullRequestReviewEvent toEvent() {
switch (this) {
case PENDING :
diff --git a/src/main/java/org/kohsuke/github/GHQueryBuilder.java b/src/main/java/org/kohsuke/github/GHQueryBuilder.java
index c111a8234e..90a9720ffd 100644
--- a/src/main/java/org/kohsuke/github/GHQueryBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHQueryBuilder.java
@@ -1,15 +1,24 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Used to specify filters, sort order, etc for listing items in a collection.
*
+ * @author Kohsuke Kawaguchi
* @param
* the type parameter
- * @author Kohsuke Kawaguchi
*/
public abstract class GHQueryBuilder extends GitHubInteractiveObject {
+
+ /** The req. */
protected final Requester req;
+ /**
+ * Instantiates a new GH query builder.
+ *
+ * @param root
+ * the root
+ */
GHQueryBuilder(GitHub root) {
super(root);
this.req = root.createRequest();
diff --git a/src/main/java/org/kohsuke/github/GHRateLimit.java b/src/main/java/org/kohsuke/github/GHRateLimit.java
index 96becb06b2..84c9345e77 100644
--- a/src/main/java/org/kohsuke/github/GHRateLimit.java
+++ b/src/main/java/org/kohsuke/github/GHRateLimit.java
@@ -21,6 +21,7 @@
import static java.util.logging.Level.FINEST;
+// TODO: Auto-generated Javadoc
/**
* Rate limit.
*
@@ -122,6 +123,18 @@ static GHRateLimit fromRecord(@Nonnull Record record, @Nonnull RateLimitTarget r
}
}
+ /**
+ * Instantiates a new GH rate limit.
+ *
+ * @param core
+ * the core
+ * @param search
+ * the search
+ * @param graphql
+ * the graphql
+ * @param integrationManifest
+ * the integration manifest
+ */
@JsonCreator
GHRateLimit(@Nonnull @JsonProperty("core") Record core,
@Nonnull @JsonProperty("search") Record search,
@@ -240,12 +253,24 @@ public Record getIntegrationManifest() {
return integrationManifest;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return "GHRateLimit {" + "core " + getCore().toString() + ", search " + getSearch().toString() + ", graphql "
+ getGraphQL().toString() + ", integrationManifest " + getIntegrationManifest().toString() + "}";
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -260,6 +285,11 @@ && getGraphQL().equals(rateLimit.getGraphQL())
&& getIntegrationManifest().equals(rateLimit.getIntegrationManifest());
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return Objects.hash(getCore(), getSearch(), getGraphQL(), getIntegrationManifest());
@@ -317,7 +347,7 @@ Record getRecord(@Nonnull RateLimitTarget rateLimitTarget) {
}
/**
- * A limit record used as a placeholder when the the actual limit is not known.
+ * A limit record used as a placeholder when the actual limit is not known.
*
* @since 1.100
*/
@@ -339,7 +369,10 @@ public static class UnknownLimitRecord extends Record {
*/
static long unknownLimitResetSeconds = defaultUnknownLimitResetSeconds;
+ /** The Constant unknownLimit. */
static final int unknownLimit = 1000000;
+
+ /** The Constant unknownRemaining. */
static final int unknownRemaining = 999999;
// The default UnknownLimitRecord is an expired record.
@@ -358,6 +391,11 @@ private UnknownLimitRecord(long resetEpochSeconds) {
super(unknownLimit, unknownRemaining, resetEpochSeconds);
}
+ /**
+ * Current.
+ *
+ * @return the record
+ */
static Record current() {
Record result = current.get();
if (result.isExpired()) {
@@ -379,8 +417,8 @@ static void reset() {
/**
* A rate limit record.
*
- * @since 1.100
* @author Liam Newman
+ * @since 1.100
*/
public static class Record {
/**
@@ -490,7 +528,7 @@ && getRemaining() <= other.getRemaining())) {
} else if (!(other instanceof UnknownLimitRecord)) {
// If the above is not the case that means other has a later reset
// or the same resent and fewer requests remaining.
- // If the other record is not an unknown record, the the other is more recent
+ // If the other record is not an unknown record, the other is more recent
return other;
} else if (this.isExpired() && !other.isExpired()) {
// The other is an unknown record.
@@ -606,12 +644,24 @@ public Date getResetDate() {
return new Date(resetDate.getTime());
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return "{" + "remaining=" + getRemaining() + ", limit=" + getLimit() + ", resetDate=" + getResetDate()
+ '}';
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -626,6 +676,11 @@ && getResetEpochSeconds() == record.getResetEpochSeconds()
&& getResetDate().equals(record.getResetDate());
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return Objects.hash(getRemaining(), getLimit(), getResetEpochSeconds(), getResetDate());
diff --git a/src/main/java/org/kohsuke/github/GHReaction.java b/src/main/java/org/kohsuke/github/GHReaction.java
index df4f230ad1..11cdfc7817 100644
--- a/src/main/java/org/kohsuke/github/GHReaction.java
+++ b/src/main/java/org/kohsuke/github/GHReaction.java
@@ -7,6 +7,7 @@
import static org.kohsuke.github.internal.Previews.SQUIRREL_GIRL;
+// TODO: Auto-generated Javadoc
/**
* Reaction to issue, comment, PR, and so on.
*
@@ -40,6 +41,8 @@ public GHUser getUser() {
/**
* Reaction has no HTML URL. Don't call this method.
+ *
+ * @return the html url
*/
@Deprecated
public URL getHtmlUrl() {
@@ -51,9 +54,9 @@ public URL getHtmlUrl() {
*
* @throws IOException
* the io exception
- * @deprecated this API is no longer supported by GitHub, keeping it as is for old versions of GitHub Enterprise
* @see Legacy Delete
* reactions REST API removed
+ * @deprecated this API is no longer supported by GitHub, keeping it as is for old versions of GitHub Enterprise
*/
@Deprecated
public void delete() throws IOException {
diff --git a/src/main/java/org/kohsuke/github/GHRef.java b/src/main/java/org/kohsuke/github/GHRef.java
index e12944c8e0..429dcfbf0a 100644
--- a/src/main/java/org/kohsuke/github/GHRef.java
+++ b/src/main/java/org/kohsuke/github/GHRef.java
@@ -6,6 +6,7 @@
import java.io.IOException;
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
* Provides information on a Git ref from GitHub.
*
@@ -16,7 +17,7 @@ public class GHRef extends GitHubInteractiveObject {
private GHObject object;
/**
- * Name of the ref, such as "refs/tags/abc"
+ * Name of the ref, such as "refs/tags/abc".
*
* @return the ref
*/
@@ -84,7 +85,7 @@ public void delete() throws IOException {
}
/**
- * Retrive a ref of the given type for the current GitHub repository.
+ * Retrieve a ref of the given type for the current GitHub repository.
*
* @param repository
* the repository to read from
@@ -163,7 +164,7 @@ public static class GHObject {
private String type, sha, url;
/**
- * Type of the object, such as "commit"
+ * Type of the object, such as "commit".
*
* @return the type
*/
diff --git a/src/main/java/org/kohsuke/github/GHRelease.java b/src/main/java/org/kohsuke/github/GHRelease.java
index cbdda11e72..12971518ae 100644
--- a/src/main/java/org/kohsuke/github/GHRelease.java
+++ b/src/main/java/org/kohsuke/github/GHRelease.java
@@ -14,6 +14,7 @@
import static java.lang.String.*;
+// TODO: Auto-generated Javadoc
/**
* Release in a github repository.
*
@@ -22,6 +23,8 @@
* @see GHRepository#createRelease(String) GHRepository#createRelease(String)
*/
public class GHRelease extends GHObject {
+
+ /** The owner. */
GHRepository owner;
private String html_url;
@@ -90,6 +93,11 @@ public GHRelease setDraft(boolean draft) throws IOException {
return update().draft(draft).update();
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
}
@@ -198,11 +206,27 @@ public String getTarballUrl() {
return tarball_url;
}
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH release
+ */
GHRelease wrap(GHRepository owner) {
this.owner = owner;
return this;
}
+ /**
+ * Wrap.
+ *
+ * @param releases
+ * the releases
+ * @param owner
+ * the owner
+ * @return the GH release[]
+ */
static GHRelease[] wrap(GHRelease[] releases, GHRepository owner) {
for (GHRelease release : releases) {
release.wrap(owner);
diff --git a/src/main/java/org/kohsuke/github/GHReleaseBuilder.java b/src/main/java/org/kohsuke/github/GHReleaseBuilder.java
index 2dff2174a4..ccc5ec63cf 100644
--- a/src/main/java/org/kohsuke/github/GHReleaseBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHReleaseBuilder.java
@@ -4,8 +4,9 @@
import java.io.IOException;
+// TODO: Auto-generated Javadoc
/**
- * Builder pattern for creating a {@link GHRelease}
+ * Builder pattern for creating a {@link GHRelease}.
*
* @see GHRepository#createRelease(String) GHRepository#createRelease(String)
*/
@@ -78,7 +79,7 @@ public GHReleaseBuilder name(String name) {
}
/**
- * Optional
+ * Optional.
*
* @param prerelease
* {@code true} to identify the release as a prerelease. {@code false} to identify the release as a full
@@ -91,7 +92,7 @@ public GHReleaseBuilder prerelease(boolean prerelease) {
}
/**
- * Optional
+ * Optional.
*
* @param categoryName
* the category of the discussion to be created for the release. Category should already exist
diff --git a/src/main/java/org/kohsuke/github/GHReleaseUpdater.java b/src/main/java/org/kohsuke/github/GHReleaseUpdater.java
index 677024164d..951d845622 100644
--- a/src/main/java/org/kohsuke/github/GHReleaseUpdater.java
+++ b/src/main/java/org/kohsuke/github/GHReleaseUpdater.java
@@ -2,6 +2,7 @@
import java.io.IOException;
+// TODO: Auto-generated Javadoc
/**
* Modifies {@link GHRelease}.
*
@@ -12,6 +13,12 @@ public class GHReleaseUpdater {
private final GHRelease base;
private final Requester builder;
+ /**
+ * Instantiates a new GH release updater.
+ *
+ * @param base
+ * the base
+ */
GHReleaseUpdater(GHRelease base) {
this.base = base;
this.builder = base.root().createRequest();
@@ -79,7 +86,7 @@ public GHReleaseUpdater name(String name) {
}
/**
- * Optional
+ * Optional.
*
* @param prerelease
* {@code true} to identify the release as a prerelease. {@code false} to identify the release as a full
@@ -92,7 +99,7 @@ public GHReleaseUpdater prerelease(boolean prerelease) {
}
/**
- * Optional
+ * Optional.
*
* @param categoryName
* the category of the discussion to be created for the release. Category should already exist
diff --git a/src/main/java/org/kohsuke/github/GHRepoHook.java b/src/main/java/org/kohsuke/github/GHRepoHook.java
index 2112cceb79..e654f591c9 100644
--- a/src/main/java/org/kohsuke/github/GHRepoHook.java
+++ b/src/main/java/org/kohsuke/github/GHRepoHook.java
@@ -1,21 +1,42 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GHRepoHook.
+ */
class GHRepoHook extends GHHook {
/**
* Repository that the hook belongs to.
*/
transient GHRepository repository;
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH repo hook
+ */
GHRepoHook wrap(GHRepository owner) {
this.repository = owner;
return this;
}
+ /**
+ * Root.
+ *
+ * @return the git hub
+ */
@Override
GitHub root() {
return repository.root();
}
+ /**
+ * Gets the api route.
+ *
+ * @return the api route
+ */
@Override
String getApiRoute() {
return String.format("/repos/%s/%s/hooks/%d", repository.getOwnerName(), repository.getName(), getId());
diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java
index 6a1c7a6d48..5220a1b80b 100644
--- a/src/main/java/org/kohsuke/github/GHRepository.java
+++ b/src/main/java/org/kohsuke/github/GHRepository.java
@@ -69,6 +69,7 @@
import static org.kohsuke.github.internal.Previews.NEBULA;
import static org.kohsuke.github.internal.Previews.SHADOW_CAT;
+// TODO: Auto-generated Javadoc
/**
* A repository on GitHub.
*
@@ -127,6 +128,19 @@ public class GHRepository extends GHObject {
private Boolean isTemplate;
private boolean compareUsePaginatedCommits;
+ /**
+ * Read.
+ *
+ * @param root
+ * the root
+ * @param owner
+ * the owner
+ * @param name
+ * the name
+ * @return the GH repository
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
static GHRepository read(GitHub root, String owner, String name) throws IOException {
return root.createRequest().withUrlPath("/repos/" + owner + '/' + name).fetch(GHRepository.class);
}
@@ -223,7 +237,7 @@ private static class GHRepoPermission {
}
/**
- * Gets node id
+ * Gets node id.
*
* @return the node id
*/
@@ -306,6 +320,11 @@ public String getSshUrl() {
return ssh_url;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
}
@@ -697,7 +716,7 @@ public boolean isAllowRebaseMerge() {
}
/**
- * Automatically deleting head branches when pull requests are merged
+ * Automatically deleting head branches when pull requests are merged.
*
* @return the boolean
*/
@@ -749,8 +768,14 @@ public boolean isPrivate() {
* Visibility of a repository.
*/
public enum Visibility {
+
+ /** The public. */
PUBLIC,
+
+ /** The internal. */
INTERNAL,
+
+ /** The private. */
PRIVATE,
/**
@@ -764,10 +789,22 @@ public enum Visibility {
*/
UNKNOWN;
+ /**
+ * From.
+ *
+ * @param value
+ * the value
+ * @return the visibility
+ */
public static Visibility from(String value) {
return EnumUtils.getNullableEnumOrDefault(Visibility.class, value, Visibility.UNKNOWN);
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return name().toLowerCase(Locale.ROOT);
@@ -910,10 +947,16 @@ public int getSize() {
}
/**
- * Affiliation of a repository collaborator
+ * Affiliation of a repository collaborator.
*/
public enum CollaboratorAffiliation {
- ALL, DIRECT, OUTSIDE
+
+ /** The all. */
+ ALL,
+ /** The direct. */
+ DIRECT,
+ /** The outside. */
+ OUTSIDE
}
/**
@@ -1022,6 +1065,21 @@ public Set getCollaboratorNames(CollaboratorAffiliation affiliation) thr
return r;
}
+ /**
+ * Checks if the given user is a collaborator for this repository.
+ *
+ * @param user
+ * a {@link GHUser}
+ * @return true if the user is a collaborator for this repository
+ * @throws IOException
+ * the io exception
+ */
+ public boolean isCollaborator(GHUser user) throws IOException {
+ return root().createRequest()
+ .withUrlPath(getApiTailUrl("collaborators/" + user.getLogin()))
+ .fetchHttpStatusCode() == 204;
+ }
+
/**
* Obtain permission for a given user in this repository.
*
@@ -1474,10 +1532,16 @@ public Setter set() {
}
/**
- * Sort orders for listing forks
+ * Sort orders for listing forks.
*/
public enum ForkSort {
- NEWEST, OLDEST, STARGAZERS
+
+ /** The newest. */
+ NEWEST,
+ /** The oldest. */
+ OLDEST,
+ /** The stargazers. */
+ STARGAZERS
}
/**
@@ -1827,7 +1891,7 @@ public GHCompare getCompare(GHBranch id1, GHBranch id2) throws IOException {
/**
* Retrieves all refs for the github repository.
*
- * @return an array of GHRef elements coresponding with the refs in the remote repository.
+ * @return an array of GHRef elements corresponding with the refs in the remote repository.
* @throws IOException
* on failure communicating with GitHub
*/
@@ -1873,7 +1937,7 @@ public PagedIterable listRefs(String refType) throws IOException {
}
/**
- * Retrive a ref of the given type for the current GitHub repository.
+ * Retrieve a ref of the given type for the current GitHub repository.
*
* @param refName
* eg: heads/branch
@@ -1900,7 +1964,7 @@ public GHTagObject getTagObject(String sha) throws IOException {
}
/**
- * Retrive a tree of the given type for the current GitHub repository.
+ * Retrieve a tree of the given type for the current GitHub repository.
*
* @param sha
* sha number or branch name ex: "main"
@@ -2065,7 +2129,6 @@ public PagedIterable listCommitComments(String commitSha) {
/**
* Gets the basic license details for the repository.
- *
*
* @return null if there's no license.
* @throws IOException
@@ -2077,8 +2140,7 @@ public GHLicense getLicense() throws IOException {
}
/**
- * Retrieves the contents of the repository's license file - makes an additional API call
- *
+ * Retrieves the contents of the repository's license file - makes an additional API call.
*
* @return details regarding the license contents, or null if there's no license.
* @throws IOException
@@ -2149,7 +2211,30 @@ public PagedIterable getCheckRuns(String ref) throws IOException {
}
/**
- * Creates a commit status
+ * Gets check runs for given ref which validate provided parameters
+ *
+ * @param ref
+ * the Git reference
+ * @param params
+ * a map of parameters to filter check runs
+ * @return check runs for the given ref
+ * @throws IOException
+ * the io exception
+ * @see List check runs
+ * for a specific ref
+ */
+ @Preview(ANTIOPE)
+ public PagedIterable getCheckRuns(String ref, Map params) throws IOException {
+ GitHubRequest request = root().createRequest()
+ .withUrlPath(String.format("/repos/%s/%s/commits/%s/check-runs", getOwnerName(), name, ref))
+ .with(params)
+ .withPreview(ANTIOPE)
+ .build();
+ return new GHCheckRunsIterable(this, request);
+ }
+
+ /**
+ * Creates a commit status.
*
* @param sha1
* the sha 1
@@ -2160,7 +2245,7 @@ public PagedIterable getCheckRuns(String ref) throws IOException {
* @param description
* Optional short description.
* @param context
- * Optinal commit status context.
+ * Optional commit status context.
* @return the gh commit status
* @throws IOException
* the io exception
@@ -2871,6 +2956,25 @@ public GHSubscription getSubscription() throws IOException {
}
}
+ // Only used within listCodeownersErrors().
+ private static class GHCodeownersErrors {
+ public List errors;
+ }
+
+ /**
+ * List errors in the {@code CODEOWNERS} file. Note that GitHub skips lines with incorrect syntax; these are
+ * reported in the web interface, but not in the API call which this library uses.
+ *
+ * @return the list of errors
+ * @throws IOException
+ * the io exception
+ */
+ public List listCodeownersErrors() throws IOException {
+ return root().createRequest()
+ .withUrlPath(getApiTailUrl("codeowners/errors"))
+ .fetch(GHCodeownersErrors.class).errors;
+ }
+
/**
* List contributors paged iterable.
*
@@ -2897,12 +3001,24 @@ public int getContributions() {
return contributions;
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
// We ignore contributions in the calculation
return super.hashCode();
}
+ /**
+ * Equals.
+ *
+ * @param obj
+ * the obj
+ * @return true, if successful
+ */
@Override
public boolean equals(Object obj) {
// We ignore contributions in the calculation
@@ -3032,11 +3148,23 @@ public GHRepositoryCloneTraffic getCloneTraffic() throws IOException {
.fetch(GHRepositoryCloneTraffic.class);
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return ("Repository:" + getOwnerName() + ":" + name).hashCode();
}
+ /**
+ * Equals.
+ *
+ * @param obj
+ * the obj
+ * @return true, if successful
+ */
@Override
public boolean equals(Object obj) {
if (obj instanceof GHRepository) {
@@ -3046,6 +3174,13 @@ public boolean equals(Object obj) {
return false;
}
+ /**
+ * Gets the api tail url.
+ *
+ * @param tail
+ * the tail
+ * @return the api tail url
+ */
String getApiTailUrl(String tail) {
if (tail.length() > 0 && !tail.startsWith("/")) {
tail = '/' + tail;
@@ -3185,7 +3320,7 @@ public GHWorkflowJob getWorkflowJob(long id) throws IOException {
}
/**
- * Gets the public key for the given repo
+ * Gets the public key for the given repo.
*
* @return the public key
* @throws IOException
@@ -3258,6 +3393,7 @@ public void createSecret(String secretName, String encryptedValue, String public
.withUrlPath(getApiTailUrl("actions/secrets") + "/" + secretName)
.send();
}
+
/**
* Create a tag. See https://developer.github.com/v3/git/tags/#create-a-tag-object
*
@@ -3270,8 +3406,8 @@ public void createSecret(String secretName, String encryptedValue, String public
* @param type
* The type of the object we're tagging: "commit", "tree" or "blob".
* @return The newly created tag.
- * @throws java.io.IOException
- * The IO exception.
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
public GHTagObject createTag(String tag, String message, String object, String type) throws IOException {
return root().createRequest()
@@ -3294,9 +3430,9 @@ public GHTagObject createTag(String tag, String message, String object, String t
* The {@link InputStreamFunction} that will process the stream
* @param ref
* if null
the repository's default branch, usually main
,
+ * @return the result of reading the stream.
* @throws IOException
* The IO exception.
- * @return the result of reading the stream.
*/
public T readZip(InputStreamFunction streamFunction, String ref) throws IOException {
return downloadArchive("zip", ref, streamFunction);
@@ -3311,9 +3447,9 @@ public T readZip(InputStreamFunction streamFunction, String ref) throws I
* The {@link InputStreamFunction} that will process the stream
* @param ref
* if null
the repository's default branch, usually main
,
+ * @return the result of reading the stream.
* @throws IOException
* The IO exception.
- * @return the result of reading the stream.
*/
public T readTar(InputStreamFunction streamFunction, String ref) throws IOException {
return downloadArchive("tar", ref, streamFunction);
@@ -3323,12 +3459,12 @@ public T readTar(InputStreamFunction streamFunction, String ref) throws I
* Create a repository dispatch event, which can be used to start a workflow/action from outside github, as
* described on https://docs.github.com/en/rest/reference/repos#create-a-repository-dispatch-event
*
+ * @param
+ * type of client payload
* @param eventType
* the eventType
* @param clientPayload
* a custom payload , can be nullable
- * @param
- * type of client payload
* @throws IOException
* the io exception
*/
@@ -3356,8 +3492,8 @@ private T downloadArchive(@Nonnull String type,
/**
* Populate this object.
*
- * @throws java.io.IOException
- * The IO exception
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
void populate() throws IOException {
if (isOffline()) {
@@ -3380,6 +3516,13 @@ void populate() throws IOException {
*/
@BetaApi
public static class Updater extends GHRepositoryBuilder {
+
+ /**
+ * Instantiates a new updater.
+ *
+ * @param repository
+ * the repository
+ */
protected Updater(@Nonnull GHRepository repository) {
super(Updater.class, repository.root(), null);
// even when we don't change the name, we need to send it in
@@ -3390,6 +3533,26 @@ protected Updater(@Nonnull GHRepository repository) {
}
}
+ /**
+ * Star a repository.
+ *
+ * @throws IOException
+ * the io exception
+ */
+ public void star() throws IOException {
+ root().createRequest().method("PUT").withUrlPath(String.format("/user/starred/%s", full_name)).send();
+ }
+
+ /**
+ * Unstar a repository.
+ *
+ * @throws IOException
+ * the io exception
+ */
+ public void unstar() throws IOException {
+ root().createRequest().method("DELETE").withUrlPath(String.format("/user/starred/%s", full_name)).send();
+ }
+
/**
* A {@link GHRepositoryBuilder} that allows multiple properties to be updated per request.
*
@@ -3397,6 +3560,13 @@ protected Updater(@Nonnull GHRepository repository) {
*/
@BetaApi
public static class Setter extends GHRepositoryBuilder {
+
+ /**
+ * Instantiates a new setter.
+ *
+ * @param repository
+ * the repository
+ */
protected Setter(@Nonnull GHRepository repository) {
super(GHRepository.class, repository.root(), null);
// even when we don't change the name, we need to send it in
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java
index 3bb297680d..17ee0041d4 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java
@@ -8,8 +8,25 @@
import static org.kohsuke.github.internal.Previews.BAPTISTE;
import static org.kohsuke.github.internal.Previews.NEBULA;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GHRepositoryBuilder.
+ *
+ * @param
+ * the generic type
+ */
abstract class GHRepositoryBuilder extends AbstractBuilder {
+ /**
+ * Instantiates a new GH repository builder.
+ *
+ * @param intermediateReturnType
+ * the intermediate return type
+ * @param root
+ * the root
+ * @param baseInstance
+ * the base instance
+ */
protected GHRepositoryBuilder(Class intermediateReturnType, GitHub root, GHRepository baseInstance) {
super(GHRepository.class, intermediateReturnType, root, baseInstance);
}
@@ -75,13 +92,11 @@ public S deleteBranchOnMerge(boolean enabled) throws IOException {
}
/**
- * Default repository branch
+ * Default repository branch.
*
* @param branch
* branch name
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -90,13 +105,11 @@ public S defaultBranch(String branch) throws IOException {
}
/**
- * Description for repository
+ * Description for repository.
*
* @param description
* description of repository
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -105,13 +118,11 @@ public S description(String description) throws IOException {
}
/**
- * Homepage for repository
+ * Homepage for repository.
*
* @param homepage
* homepage of repository
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -120,13 +131,11 @@ public S homepage(URL homepage) throws IOException {
}
/**
- * Homepage for repository
+ * Homepage for repository.
*
* @param homepage
* homepage of repository
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -135,13 +144,11 @@ public S homepage(String homepage) throws IOException {
}
/**
- * Sets the repository to private
+ * Sets the repository to private.
*
* @param enabled
* private if true
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -150,7 +157,7 @@ public S private_(boolean enabled) throws IOException {
}
/**
- * Sets the repository visibility
+ * Sets the repository visibility.
*
* @param visibility
* visibility of repository
@@ -164,13 +171,11 @@ public S visibility(final Visibility visibility) throws IOException {
}
/**
- * Enables issue tracker
+ * Enables issue tracker.
*
* @param enabled
* true if enabled
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -179,13 +184,11 @@ public S issues(boolean enabled) throws IOException {
}
/**
- * Enables projects
+ * Enables projects.
*
* @param enabled
* true if enabled
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -194,7 +197,7 @@ public S projects(boolean enabled) throws IOException {
}
/**
- * Enables wiki
+ * Enables wiki.
*
* @param enabled
* true if enabled
@@ -207,13 +210,11 @@ public S wiki(boolean enabled) throws IOException {
}
/**
- * Enables downloads
+ * Enables downloads.
*
* @param enabled
* true if enabled
- *
* @return a builder to continue with building
- *
* @throws IOException
* In case of any networking error or error from the server.
*/
@@ -236,15 +237,38 @@ public S isTemplate(boolean enabled) throws IOException {
return with("is_template", enabled);
}
+ /**
+ * Done.
+ *
+ * @return the GH repository
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public GHRepository done() throws IOException {
return super.done();
}
+ /**
+ * Archive.
+ *
+ * @return the s
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
S archive() throws IOException {
return with("archived", true);
}
+ /**
+ * Name.
+ *
+ * @param name
+ * the name
+ * @return the s
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
S name(String name) throws IOException {
return with("name", name);
}
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java b/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java
index e0c4d7d32e..6d7bf15140 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryCloneTraffic.java
@@ -3,6 +3,7 @@
import java.util.Collections;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* Repository clone statistics.
*
@@ -11,9 +12,22 @@
public class GHRepositoryCloneTraffic extends GHRepositoryTraffic {
private List clones;
+ /**
+ * Instantiates a new GH repository clone traffic.
+ */
GHRepositoryCloneTraffic() {
}
+ /**
+ * Instantiates a new GH repository clone traffic.
+ *
+ * @param count
+ * the count
+ * @param uniques
+ * the uniques
+ * @param clones
+ * the clones
+ */
GHRepositoryCloneTraffic(Integer count, Integer uniques, List clones) {
super(count, uniques);
this.clones = clones;
@@ -28,6 +42,11 @@ public List getClones() {
return Collections.unmodifiableList(clones);
}
+ /**
+ * Gets the daily info.
+ *
+ * @return the daily info
+ */
public List getDailyInfo() {
return getClones();
}
@@ -36,9 +55,23 @@ public List getDailyInfo() {
* The type DailyInfo.
*/
public static class DailyInfo extends GHRepositoryTraffic.DailyInfo {
+
+ /**
+ * Instantiates a new daily info.
+ */
DailyInfo() {
}
+ /**
+ * Instantiates a new daily info.
+ *
+ * @param timestamp
+ * the timestamp
+ * @param count
+ * the count
+ * @param uniques
+ * the uniques
+ */
DailyInfo(String timestamp, int count, int uniques) {
super(timestamp, count, uniques);
}
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java b/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java
index 7b84c6e023..39033d0a9a 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryDiscussion.java
@@ -6,6 +6,7 @@
import java.net.URL;
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* A discussion in the repository.
*
@@ -40,62 +41,141 @@ public class GHRepositoryDiscussion extends GHObject {
private String body;
private String timelineUrl;
+ /**
+ * Gets the category.
+ *
+ * @return the category
+ */
public Category getCategory() {
return category;
}
+ /**
+ * Gets the answer html url.
+ *
+ * @return the answer html url
+ */
public URL getAnswerHtmlUrl() {
return GitHubClient.parseURL(answerHtmlUrl);
}
+ /**
+ * Gets the answer chosen at.
+ *
+ * @return the answer chosen at
+ */
public Date getAnswerChosenAt() {
return GitHubClient.parseDate(answerChosenAt);
}
+ /**
+ * Gets the answer chosen by.
+ *
+ * @return the answer chosen by
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public GHUser getAnswerChosenBy() throws IOException {
return root().intern(answerChosenBy);
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
public URL getHtmlUrl() {
return GitHubClient.parseURL(htmlUrl);
}
+ /**
+ * Gets the number.
+ *
+ * @return the number
+ */
public int getNumber() {
return number;
}
+ /**
+ * Gets the title.
+ *
+ * @return the title
+ */
public String getTitle() {
return title;
}
+ /**
+ * Gets the user.
+ *
+ * @return the user
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
public GHUser getUser() throws IOException {
return root().intern(user);
}
+ /**
+ * Gets the state.
+ *
+ * @return the state
+ */
public State getState() {
return EnumUtils.getEnumOrDefault(State.class, state, State.UNKNOWN);
}
+ /**
+ * Checks if is locked.
+ *
+ * @return true, if is locked
+ */
public boolean isLocked() {
return locked;
}
+ /**
+ * Gets the comments.
+ *
+ * @return the comments
+ */
public int getComments() {
return comments;
}
+ /**
+ * Gets the author association.
+ *
+ * @return the author association
+ */
public GHCommentAuthorAssociation getAuthorAssociation() {
return authorAssociation;
}
+ /**
+ * Gets the active lock reason.
+ *
+ * @return the active lock reason
+ */
public String getActiveLockReason() {
return activeLockReason;
}
+ /**
+ * Gets the body.
+ *
+ * @return the body
+ */
public String getBody() {
return body;
}
+ /**
+ * Gets the timeline url.
+ *
+ * @return the timeline url
+ */
public String getTimelineUrl() {
return timelineUrl;
}
@@ -123,48 +203,107 @@ public static class Category {
private String slug;
private boolean isAnswerable;
+ /**
+ * Gets the id.
+ *
+ * @return the id
+ */
public long getId() {
return id;
}
+ /**
+ * Gets the node id.
+ *
+ * @return the node id
+ */
public String getNodeId() {
return nodeId;
}
+ /**
+ * Gets the repository id.
+ *
+ * @return the repository id
+ */
public long getRepositoryId() {
return repositoryId;
}
+ /**
+ * Gets the emoji.
+ *
+ * @return the emoji
+ */
public String getEmoji() {
return emoji;
}
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
public String getName() {
return name;
}
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
public String getDescription() {
return description;
}
+ /**
+ * Gets the created at.
+ *
+ * @return the created at
+ */
public Date getCreatedAt() {
return GitHubClient.parseDate(createdAt);
}
+ /**
+ * Gets the updated at.
+ *
+ * @return the updated at
+ */
public Date getUpdatedAt() {
return GitHubClient.parseDate(updatedAt);
}
+ /**
+ * Gets the slug.
+ *
+ * @return the slug
+ */
public String getSlug() {
return slug;
}
+ /**
+ * Checks if is answerable.
+ *
+ * @return true, if is answerable
+ */
public boolean isAnswerable() {
return isAnswerable;
}
}
+ /**
+ * The Enum State.
+ */
public enum State {
- OPEN, LOCKED, UNKNOWN;
+
+ /** The open. */
+ OPEN,
+ /** The locked. */
+ LOCKED,
+ /** The unknown. */
+ UNKNOWN;
}
}
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java b/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java
index 506987e53c..9d7ab86c71 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryPublicKey.java
@@ -5,8 +5,9 @@
import java.io.IOException;
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
- * A public key for the given repository
+ * A public key for the given repository.
*
* @author Aditya Bansal
*/
@@ -18,19 +19,43 @@ public class GHRepositoryPublicKey extends GHObject {
private String keyId;
private String key;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
return null;
}
+ /**
+ * Gets the key id.
+ *
+ * @return the key id
+ */
public String getKeyId() {
return keyId;
}
+ /**
+ * Gets the key.
+ *
+ * @return the key
+ */
public String getKey() {
return key;
}
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH repository public key
+ */
GHRepositoryPublicKey wrapUp(GHRepository owner) {
this.owner = owner;
return this;
diff --git a/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java b/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java
index 3bddaafa23..7a21cf941a 100644
--- a/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHRepositorySearchBuilder.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Search repositories.
*
@@ -7,6 +8,13 @@
* @see GitHub#searchRepositories() GitHub#searchRepositories()
*/
public class GHRepositorySearchBuilder extends GHSearchBuilder {
+
+ /**
+ * Instantiates a new GH repository search builder.
+ *
+ * @param root
+ * the root
+ */
GHRepositorySearchBuilder(GitHub root) {
super(root, RepositorySearchResult.class);
}
@@ -122,11 +130,10 @@ public GHRepositorySearchBuilder fork(GHFork fork) {
}
/**
- * Search by repository visibility
+ * Search by repository visibility.
*
* @param visibility
* repository visibility
- *
* @return the gh repository search builder
* @throws GHException
* if {@link GHRepository.Visibility#UNKNOWN} is passed. UNKNOWN is a placeholder for unexpected values
@@ -260,7 +267,13 @@ public GHRepositorySearchBuilder sort(Sort sort) {
* The enum Sort.
*/
public enum Sort {
- STARS, FORKS, UPDATED
+
+ /** The stars. */
+ STARS,
+ /** The forks. */
+ FORKS,
+ /** The updated. */
+ UPDATED
}
/**
@@ -293,10 +306,22 @@ public enum Fork {
PARENT_ONLY("");
private String filterMode;
+
+ /**
+ * Instantiates a new fork.
+ *
+ * @param mode
+ * the mode
+ */
Fork(final String mode) {
this.filterMode = mode;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return filterMode;
@@ -314,6 +339,11 @@ GHRepository[] getItems(GitHub root) {
}
}
+ /**
+ * Gets the api url.
+ *
+ * @return the api url
+ */
@Override
protected String getApiUrl() {
return "/search/repositories";
diff --git a/src/main/java/org/kohsuke/github/GHRepositorySelection.java b/src/main/java/org/kohsuke/github/GHRepositorySelection.java
index 5039545213..2833eeabcd 100644
--- a/src/main/java/org/kohsuke/github/GHRepositorySelection.java
+++ b/src/main/java/org/kohsuke/github/GHRepositorySelection.java
@@ -2,6 +2,7 @@
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* App installation repository selection.
*
@@ -9,10 +10,16 @@
* @see GHAppInstallation
*/
public enum GHRepositorySelection {
- SELECTED, ALL;
+
+ /** The selected. */
+ SELECTED,
+ /** The all. */
+ ALL;
/**
* Returns GitHub's internal representation of this event.
+ *
+ * @return the string
*/
String symbol() {
return name().toLowerCase(Locale.ENGLISH);
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java b/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java
index aaa8e87d64..35c8bfea55 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryStatistics.java
@@ -11,6 +11,7 @@
import java.util.List;
import java.util.NoSuchElementException;
+// TODO: Auto-generated Javadoc
/**
* Statistics for a GitHub repository.
*
@@ -102,6 +103,13 @@ public static class ContributorStats extends GHObject {
private int total;
private List weeks;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
@@ -156,6 +164,11 @@ public List getWeeks() {
return Collections.unmodifiableList(weeks);
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return author.getLogin() + " made " + String.valueOf(total) + " contributions over "
@@ -212,6 +225,11 @@ public int getNumberOfCommits() {
return c;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return String.format("Week starting %d - Additions: %d, Deletions: %d, Commits: %d", w, a, d, c);
@@ -271,6 +289,13 @@ public long getWeek() {
return week;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
@@ -345,6 +370,11 @@ public long getDeletions() {
return deletions;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return "Week starting " + getWeekTimestamp() + " has " + getAdditions() + " additions and "
@@ -371,6 +401,13 @@ public static class Participation extends GHObject {
private List all;
private List owner;
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
@@ -453,11 +490,23 @@ public long getNumberOfCommits() {
return numberOfCommits;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
public String toString() {
return "Day " + getDayOfWeek() + " Hour " + getHourOfDay() + ": " + getNumberOfCommits() + " commits";
}
}
+ /**
+ * Gets the api tail url.
+ *
+ * @param tail
+ * the tail
+ * @return the api tail url
+ */
String getApiTailUrl(String tail) {
return repo.getApiTailUrl("stats/" + tail);
}
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java b/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java
index 1dbd4942b0..49738fceff 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryTraffic.java
@@ -3,6 +3,7 @@
import java.util.Date;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* The type GHRepositoryTraffic.
*/
@@ -10,18 +11,39 @@ public abstract class GHRepositoryTraffic implements TrafficInfo {
private int count;
private int uniques;
+ /**
+ * Instantiates a new GH repository traffic.
+ */
GHRepositoryTraffic() {
}
+ /**
+ * Instantiates a new GH repository traffic.
+ *
+ * @param count
+ * the count
+ * @param uniques
+ * the uniques
+ */
GHRepositoryTraffic(int count, int uniques) {
this.count = count;
this.uniques = uniques;
}
+ /**
+ * Gets the count.
+ *
+ * @return the count
+ */
public int getCount() {
return count;
}
+ /**
+ * Gets the uniques.
+ *
+ * @return the uniques
+ */
public int getUniques() {
return uniques;
}
@@ -50,17 +72,40 @@ public Date getTimestamp() {
return GitHubClient.parseDate(timestamp);
}
+ /**
+ * Gets the count.
+ *
+ * @return the count
+ */
public int getCount() {
return count;
}
+ /**
+ * Gets the uniques.
+ *
+ * @return the uniques
+ */
public int getUniques() {
return uniques;
}
+ /**
+ * Instantiates a new daily info.
+ */
DailyInfo() {
}
+ /**
+ * Instantiates a new daily info.
+ *
+ * @param timestamp
+ * the timestamp
+ * @param count
+ * the count
+ * @param uniques
+ * the uniques
+ */
DailyInfo(String timestamp, Integer count, Integer uniques) {
this.timestamp = timestamp;
this.count = count;
diff --git a/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java b/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java
index 65e88ef6f9..669b919fa2 100644
--- a/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java
+++ b/src/main/java/org/kohsuke/github/GHRepositoryViewTraffic.java
@@ -3,6 +3,7 @@
import java.util.Collections;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* Repository view statistics.
*
@@ -11,9 +12,22 @@
public class GHRepositoryViewTraffic extends GHRepositoryTraffic {
private List views;
+ /**
+ * Instantiates a new GH repository view traffic.
+ */
GHRepositoryViewTraffic() {
}
+ /**
+ * Instantiates a new GH repository view traffic.
+ *
+ * @param count
+ * the count
+ * @param uniques
+ * the uniques
+ * @param views
+ * the views
+ */
GHRepositoryViewTraffic(int count, int uniques, List views) {
super(count, uniques);
this.views = views;
@@ -28,6 +42,11 @@ public List getViews() {
return Collections.unmodifiableList(views);
}
+ /**
+ * Gets the daily info.
+ *
+ * @return the daily info
+ */
public List getDailyInfo() {
return getViews();
}
@@ -36,9 +55,23 @@ public List getDailyInfo() {
* The type DailyInfo.
*/
public static class DailyInfo extends GHRepositoryTraffic.DailyInfo {
+
+ /**
+ * Instantiates a new daily info.
+ */
DailyInfo() {
}
+ /**
+ * Instantiates a new daily info.
+ *
+ * @param timestamp
+ * the timestamp
+ * @param count
+ * the count
+ * @param uniques
+ * the uniques
+ */
DailyInfo(String timestamp, int count, int uniques) {
super(timestamp, count, uniques);
}
diff --git a/src/main/java/org/kohsuke/github/GHRequestedAction.java b/src/main/java/org/kohsuke/github/GHRequestedAction.java
index 0d5efe3541..b2a88757bf 100644
--- a/src/main/java/org/kohsuke/github/GHRequestedAction.java
+++ b/src/main/java/org/kohsuke/github/GHRequestedAction.java
@@ -4,6 +4,10 @@
import java.net.URL;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class GHRequestedAction.
+ */
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD", "URF_UNREAD_FIELD" },
justification = "JSON API")
public class GHRequestedAction extends GHObject {
@@ -12,24 +16,49 @@ public class GHRequestedAction extends GHObject {
private String label;
private String description;
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH requested action
+ */
GHRequestedAction wrap(GHRepository owner) {
this.owner = owner;
return this;
}
+ /**
+ * Gets the identifier.
+ *
+ * @return the identifier
+ */
String getIdentifier() {
return identifier;
}
+ /**
+ * Gets the label.
+ *
+ * @return the label
+ */
String getLabel() {
return label;
}
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
String getDescription() {
return description;
}
/**
+ * Gets the html url.
+ *
+ * @return the html url
* @deprecated This object has no HTML URL.
*/
@Override
diff --git a/src/main/java/org/kohsuke/github/GHSearchBuilder.java b/src/main/java/org/kohsuke/github/GHSearchBuilder.java
index d4268983e2..d7a25353ee 100644
--- a/src/main/java/org/kohsuke/github/GHSearchBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHSearchBuilder.java
@@ -8,14 +8,17 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* Base class for various search builders.
*
+ * @author Kohsuke Kawaguchi
* @param
* the type parameter
- * @author Kohsuke Kawaguchi
*/
public abstract class GHSearchBuilder extends GHQueryBuilder {
+
+ /** The terms. */
protected final List terms = new ArrayList();
/**
@@ -23,6 +26,14 @@ public abstract class GHSearchBuilder extends GHQueryBuilder {
*/
private final Class extends SearchResult> receiverType;
+ /**
+ * Instantiates a new GH search builder.
+ *
+ * @param root
+ * the root
+ * @param receiverType
+ * the receiver type
+ */
GHSearchBuilder(GitHub root, Class extends SearchResult> receiverType) {
super(root);
this.receiverType = receiverType;
@@ -68,6 +79,8 @@ GHQueryBuilder q(@Nonnull final String qualifier, @CheckForNull final String
/**
* Performs the search.
+ *
+ * @return the paged search iterable
*/
@Override
public PagedSearchIterable list() {
diff --git a/src/main/java/org/kohsuke/github/GHStargazer.java b/src/main/java/org/kohsuke/github/GHStargazer.java
index 69a7b617e1..ff6327d317 100644
--- a/src/main/java/org/kohsuke/github/GHStargazer.java
+++ b/src/main/java/org/kohsuke/github/GHStargazer.java
@@ -4,6 +4,7 @@
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* A stargazer at a repository on GitHub.
*
@@ -17,7 +18,7 @@ public class GHStargazer {
private GHUser user;
/**
- * Gets the repository that is stargazed
+ * Gets the repository that is stargazed.
*
* @return the starred repository
*/
@@ -37,7 +38,7 @@ public Date getStarredAt() {
}
/**
- * Gets the user that starred the repository
+ * Gets the user that starred the repository.
*
* @return the stargazer user
*/
@@ -46,6 +47,12 @@ public GHUser getUser() {
return user;
}
+ /**
+ * Wrap up.
+ *
+ * @param repository
+ * the repository
+ */
void wrapUp(GHRepository repository) {
this.repository = repository;
}
diff --git a/src/main/java/org/kohsuke/github/GHSubscription.java b/src/main/java/org/kohsuke/github/GHSubscription.java
index 046aed305f..9f84161cc8 100644
--- a/src/main/java/org/kohsuke/github/GHSubscription.java
+++ b/src/main/java/org/kohsuke/github/GHSubscription.java
@@ -5,6 +5,7 @@
import java.io.IOException;
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* Represents your subscribing to a repository / conversation thread..
*
@@ -92,6 +93,13 @@ public void delete() throws IOException {
root().createRequest().method("DELETE").withUrlPath(repo.getApiTailUrl("subscription")).send();
}
+ /**
+ * Wrap up.
+ *
+ * @param repo
+ * the repo
+ * @return the GH subscription
+ */
GHSubscription wrapUp(GHRepository repo) {
this.repo = repo;
return this;
diff --git a/src/main/java/org/kohsuke/github/GHTag.java b/src/main/java/org/kohsuke/github/GHTag.java
index a9c353ba3c..b40c491332 100644
--- a/src/main/java/org/kohsuke/github/GHTag.java
+++ b/src/main/java/org/kohsuke/github/GHTag.java
@@ -2,8 +2,9 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
- * Represents a tag in {@link GHRepository}
+ * Represents a tag in {@link GHRepository}.
*
* @see GHRepository#listTags() GHRepository#listTags()
*/
@@ -15,6 +16,13 @@ public class GHTag extends GitHubInteractiveObject {
private String name;
private GHCommit commit;
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH tag
+ */
GHTag wrap(GHRepository owner) {
this.owner = owner;
if (commit != null)
diff --git a/src/main/java/org/kohsuke/github/GHTagObject.java b/src/main/java/org/kohsuke/github/GHTagObject.java
index 854fcb6a67..efd38a3918 100644
--- a/src/main/java/org/kohsuke/github/GHTagObject.java
+++ b/src/main/java/org/kohsuke/github/GHTagObject.java
@@ -2,8 +2,9 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
- * Represents an annotated tag in a {@link GHRepository}
+ * Represents an annotated tag in a {@link GHRepository}.
*
* @see GHRepository#getTagObject(String) GHRepository#getTagObject(String)
*/
@@ -20,6 +21,13 @@ public class GHTagObject extends GitHubInteractiveObject {
private GHRef.GHObject object;
private GHVerification verification;
+ /**
+ * Wrap.
+ *
+ * @param owner
+ * the owner
+ * @return the GH tag object
+ */
GHTagObject wrap(GHRepository owner) {
this.owner = owner;
return this;
diff --git a/src/main/java/org/kohsuke/github/GHTargetType.java b/src/main/java/org/kohsuke/github/GHTargetType.java
index 050c27e4f6..2701fa59b8 100644
--- a/src/main/java/org/kohsuke/github/GHTargetType.java
+++ b/src/main/java/org/kohsuke/github/GHTargetType.java
@@ -4,6 +4,7 @@
import java.util.Locale;
+// TODO: Auto-generated Javadoc
/**
* App installation target type.
*
@@ -11,10 +12,16 @@
* @see GHAppInstallation
*/
public enum GHTargetType {
- ORGANIZATION, USER;
+
+ /** The organization. */
+ ORGANIZATION,
+ /** The user. */
+ USER;
/**
* Returns GitHub's internal representation of this event.
+ *
+ * @return the string
*/
String symbol() {
return StringUtils.capitalize(name().toLowerCase(Locale.ENGLISH));
diff --git a/src/main/java/org/kohsuke/github/GHTeam.java b/src/main/java/org/kohsuke/github/GHTeam.java
index c0f7cade3d..d7083aaf6d 100644
--- a/src/main/java/org/kohsuke/github/GHTeam.java
+++ b/src/main/java/org/kohsuke/github/GHTeam.java
@@ -15,6 +15,7 @@
import static org.kohsuke.github.GitHubRequest.transformEnum;
+// TODO: Auto-generated Javadoc
/**
* A team in GitHub organization.
*
@@ -30,18 +31,24 @@ public class GHTeam extends GHObject implements Refreshable {
private GHOrganization organization; // populated by GET /user/teams where Teams+Orgs are returned together
+ /**
+ * The Enum Privacy.
+ */
public enum Privacy {
- SECRET, // only visible to organization owners and members of this team.
+
+ /** The secret. */
+ SECRET,
+ /** The closed. */
+ // only visible to organization owners and members of this team.
CLOSED // visible to all members of this organization.
}
/**
- * Member's role in a team
+ * Member's role in a team.
*/
public enum Role {
- /**
- * A normal member of the team
- */
+
+ /** A normal member of the team. */
MEMBER,
/**
* Able to add/remove other team members, promote other team members to team maintainer, and edit the team's
@@ -50,11 +57,25 @@ public enum Role {
MAINTAINER
}
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH team
+ */
GHTeam wrapUp(GHOrganization owner) {
this.organization = owner;
return this;
}
+ /**
+ * Wrap up.
+ *
+ * @param root
+ * the root
+ * @return the GH team
+ */
GHTeam wrapUp(GitHub root) { // auto-wrapUp when organization is known from GET /user/teams
return wrapUp(organization);
}
@@ -172,11 +193,8 @@ public PagedIterable listMembers(Role role) throws IOException {
* @param discussionNumber
* id of the discussion that we want to query for
* @return the discussion
- * @throws java.io.FileNotFoundException
- * if the discussion does not exist
* @throws IOException
* the io exception
- *
* @see documentation
*/
@Nonnull
@@ -416,16 +434,34 @@ public GHOrganization getOrganization() throws IOException {
return organization;
}
+ /**
+ * Refresh.
+ *
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public void refresh() throws IOException {
root().createRequest().withUrlPath(api("")).fetchInto(this).wrapUp(root());
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(html_url);
}
+ /**
+ * Equals.
+ *
+ * @param o
+ * the o
+ * @return true, if successful
+ */
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -440,6 +476,11 @@ public boolean equals(Object o) {
&& Objects.equals(description, ghTeam.description) && privacy == ghTeam.privacy;
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return Objects.hash(name, getUrl(), permission, slug, description, privacy);
diff --git a/src/main/java/org/kohsuke/github/GHTeamBuilder.java b/src/main/java/org/kohsuke/github/GHTeamBuilder.java
index 36c300c087..f1583fb8db 100644
--- a/src/main/java/org/kohsuke/github/GHTeamBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHTeamBuilder.java
@@ -4,15 +4,28 @@
import java.io.IOException;
+// TODO: Auto-generated Javadoc
/**
* Creates a team.
*
* https://developer.github.com/v3/teams/#create-team
*/
public class GHTeamBuilder extends GitHubInteractiveObject {
+
+ /** The builder. */
protected final Requester builder;
private final String orgName;
+ /**
+ * Instantiates a new GH team builder.
+ *
+ * @param root
+ * the root
+ * @param orgName
+ * the org name
+ * @param name
+ * the name
+ */
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected")
public GHTeamBuilder(GitHub root, String orgName, String name) {
super(root);
@@ -58,7 +71,7 @@ public GHTeamBuilder repositories(String... repoNames) {
}
/**
- * Description for this team
+ * Description for this team.
*
* @param privacy
* privacy of team
@@ -70,7 +83,7 @@ public GHTeamBuilder privacy(GHTeam.Privacy privacy) {
}
/**
- * Parent team id for this team
+ * Parent team id for this team.
*
* @param parentTeamId
* parentTeamId of team
diff --git a/src/main/java/org/kohsuke/github/GHThread.java b/src/main/java/org/kohsuke/github/GHThread.java
index b7122ba6f9..383f2b2fef 100644
--- a/src/main/java/org/kohsuke/github/GHThread.java
+++ b/src/main/java/org/kohsuke/github/GHThread.java
@@ -7,6 +7,7 @@
import java.net.URL;
import java.util.Date;
+// TODO: Auto-generated Javadoc
/**
* A conversation in the notification API.
*
@@ -24,10 +25,21 @@ public class GHThread extends GHObject {
private String last_read_at;
private String url, subscription_url;
+ /**
+ * The Class Subject.
+ */
static class Subject {
+
+ /** The title. */
String title;
+
+ /** The url. */
String url;
+
+ /** The latest comment url. */
String latest_comment_url;
+
+ /** The type. */
String type;
}
@@ -44,6 +56,9 @@ public Date getLastReadAt() {
}
/**
+ * Gets the html url.
+ *
+ * @return the html url
* @deprecated This object has no HTML URL.
*/
@Override
diff --git a/src/main/java/org/kohsuke/github/GHTree.java b/src/main/java/org/kohsuke/github/GHTree.java
index 3df7813a73..6a2be8a55e 100644
--- a/src/main/java/org/kohsuke/github/GHTree.java
+++ b/src/main/java/org/kohsuke/github/GHTree.java
@@ -5,6 +5,7 @@
import java.util.Collections;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* Provides information for Git Trees https://developer.github.com/v3/git/trees/
*
@@ -14,6 +15,8 @@
* @see GHTreeEntry#asTree() GHTreeEntry#asTree()
*/
public class GHTree {
+
+ /** The repo. */
/* package almost final */GHRepository repo;
private boolean truncated;
@@ -21,7 +24,7 @@ public class GHTree {
private GHTreeEntry[] tree;
/**
- * The SHA for this trees
+ * The SHA for this trees.
*
* @return the sha
*/
@@ -30,7 +33,7 @@ public String getSha() {
}
/**
- * Return an array of entries of the trees
+ * Return an array of entries of the trees.
*
* @return the tree
*/
@@ -58,7 +61,7 @@ public GHTreeEntry getEntry(String path) {
/**
* Returns true if the number of items in the tree array exceeded the GitHub maximum limit.
*
- * @return true true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false.
+ * @return true if the number of items in the tree array exceeded the GitHub maximum limit otherwise false.
*/
public boolean isTruncated() {
return truncated;
@@ -74,6 +77,13 @@ public URL getUrl() {
return GitHubClient.parseURL(url);
}
+ /**
+ * Wrap.
+ *
+ * @param repo
+ * the repo
+ * @return the GH tree
+ */
GHTree wrap(GHRepository repo) {
this.repo = repo;
for (GHTreeEntry e : tree) {
diff --git a/src/main/java/org/kohsuke/github/GHTreeBuilder.java b/src/main/java/org/kohsuke/github/GHTreeBuilder.java
index 56da375cae..8d4a3b91c9 100644
--- a/src/main/java/org/kohsuke/github/GHTreeBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHTreeBuilder.java
@@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.List;
+// TODO: Auto-generated Javadoc
/**
* Builder pattern for creating a new tree. Based on https://developer.github.com/v3/git/trees/#create-a-tree
*/
@@ -36,6 +37,12 @@ private TreeEntry(String path, String mode, String type) {
}
}
+ /**
+ * Instantiates a new GH tree builder.
+ *
+ * @param repo
+ * the repo
+ */
GHTreeBuilder(GHRepository repo) {
this.repo = repo;
req = repo.root().createRequest();
diff --git a/src/main/java/org/kohsuke/github/GHTreeEntry.java b/src/main/java/org/kohsuke/github/GHTreeEntry.java
index 99df3bdd48..4941365f31 100644
--- a/src/main/java/org/kohsuke/github/GHTreeEntry.java
+++ b/src/main/java/org/kohsuke/github/GHTreeEntry.java
@@ -4,6 +4,7 @@
import java.io.InputStream;
import java.net.URL;
+// TODO: Auto-generated Javadoc
/**
* Provides information for Git Trees https://developer.github.com/v3/git/trees/
*
@@ -11,6 +12,8 @@
* @see GHTree
*/
public class GHTreeEntry {
+
+ /** The tree. */
/* package almost final */GHTree tree;
private String path, mode, type, sha, url;
@@ -26,7 +29,7 @@ public String getPath() {
}
/**
- * Get mode such as 100644
+ * Get mode such as 100644.
*
* @return the mode
*/
@@ -35,7 +38,7 @@ public String getMode() {
}
/**
- * Gets the size of the file, such as 132
+ * Gets the size of the file, such as 132.
*
* @return The size of the path or 0 if it is a directory
*/
diff --git a/src/main/java/org/kohsuke/github/GHUser.java b/src/main/java/org/kohsuke/github/GHUser.java
index a46c0161c1..9d1fb057b8 100644
--- a/src/main/java/org/kohsuke/github/GHUser.java
+++ b/src/main/java/org/kohsuke/github/GHUser.java
@@ -30,6 +30,7 @@
import static org.kohsuke.github.internal.Previews.INERTIA;
+// TODO: Auto-generated Javadoc
/**
* Represents an user of GitHub.
*
@@ -37,6 +38,7 @@
*/
public class GHUser extends GHPerson {
+ /** The ldap dn. */
protected String ldap_dn;
/**
@@ -71,7 +73,7 @@ public void unfollow() throws IOException {
}
/**
- * Lists the users that this user is following
+ * Lists the users that this user is following.
*
* @return the follows
* @throws IOException
@@ -83,7 +85,7 @@ public GHPersonSet getFollows() throws IOException {
}
/**
- * Lists the users that this user is following
+ * Lists the users that this user is following.
*
* @return the paged iterable
*/
@@ -189,7 +191,7 @@ public boolean isPublicMemberOf(GHOrganization org) {
}
/**
- * Returns true if this user is marked as hireable, false otherwise
+ * Returns true if this user is marked as hireable, false otherwise.
*
* @return if the user is marked as hireable
*/
@@ -197,6 +199,11 @@ public boolean isHireable() {
return hireable;
}
+ /**
+ * Gets the bio.
+ *
+ * @return the bio
+ */
public String getBio() {
return bio;
}
@@ -224,6 +231,10 @@ public GHPersonSet getOrganizations() throws IOException {
/**
* Lists events performed by a user (this includes private events if the caller is authenticated.
+ *
+ * @return the paged iterable
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
public PagedIterable listEvents() throws IOException {
return root().createRequest()
@@ -248,24 +259,34 @@ public PagedIterable listGists() throws IOException {
* Gets LDAP information for user.
*
* @return The LDAP information
- *
+ * @throws IOException
+ * the io exception
* @see Github
* LDAP
- *
- * @throws IOException
- * the io exception
*/
public Optional getLdapDn() throws IOException {
super.populate();
return Optional.ofNullable(ldap_dn);
}
+ /**
+ * Hash code.
+ *
+ * @return the int
+ */
@Override
public int hashCode() {
return login.hashCode();
}
+ /**
+ * Equals.
+ *
+ * @param obj
+ * the obj
+ * @return true, if successful
+ */
@Override
public boolean equals(Object obj) {
if (obj instanceof GHUser) {
@@ -275,6 +296,13 @@ public boolean equals(Object obj) {
return false;
}
+ /**
+ * Gets the api tail url.
+ *
+ * @param tail
+ * the tail
+ * @return the api tail url
+ */
String getApiTailUrl(String tail) {
if (tail.length() > 0 && !tail.startsWith("/"))
tail = '/' + tail;
diff --git a/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java b/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java
index c310354364..8276b3d8e4 100644
--- a/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHUserSearchBuilder.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Search users.
*
@@ -7,12 +8,23 @@
* @see GitHub#searchUsers() GitHub#searchUsers()
*/
public class GHUserSearchBuilder extends GHSearchBuilder {
+
+ /**
+ * Instantiates a new GH user search builder.
+ *
+ * @param root
+ * the root
+ */
GHUserSearchBuilder(GitHub root) {
super(root, UserSearchResult.class);
}
/**
* Search terms.
+ *
+ * @param term
+ * the term
+ * @return the GH user search builder
*/
public GHUserSearchBuilder q(String term) {
super.q(term);
@@ -124,7 +136,13 @@ public GHUserSearchBuilder sort(Sort sort) {
* The enum Sort.
*/
public enum Sort {
- FOLLOWERS, REPOSITORIES, JOINED
+
+ /** The followers. */
+ FOLLOWERS,
+ /** The repositories. */
+ REPOSITORIES,
+ /** The joined. */
+ JOINED
}
private static class UserSearchResult extends SearchResult {
@@ -136,6 +154,11 @@ GHUser[] getItems(GitHub root) {
}
}
+ /**
+ * Gets the api url.
+ *
+ * @return the api url
+ */
@Override
protected String getApiUrl() {
return "/search/users";
diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java
index d6b8d89d99..382d39a26e 100644
--- a/src/main/java/org/kohsuke/github/GHVerification.java
+++ b/src/main/java/org/kohsuke/github/GHVerification.java
@@ -2,16 +2,16 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+// TODO: Auto-generated Javadoc
/**
* The commit/tag can be signed by user. This object holds the verification status. Whether the Commit/Tag is signed or
* not.
*
+ * @author Sourabh Sarvotham Parkala
* @see tags signature
- * verificatiion
+ * verification
* @see commits signature
- * verificatiion
- *
- * @author Sourabh Sarvotham Parkala
+ * verification
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
@@ -32,7 +32,7 @@ public boolean isVerified() {
/**
* Gets reason for verification value.
*
- * @return return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in
+ * @return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in
* {@link Reason}}
*/
public Reason getReason() {
@@ -60,23 +60,49 @@ public String getPayload() {
/**
* The possible values for reason in verification object from github.
*
+ * @author Sourabh Sarvotham Parkala
* @see List of possible
* reason values
- * @author Sourabh Sarvotham Parkala
*/
public enum Reason {
+
+ /** The expired key. */
EXPIRED_KEY,
+
+ /** The not signing key. */
NOT_SIGNING_KEY,
+
+ /** The gpgverify error. */
GPGVERIFY_ERROR,
+
+ /** The gpgverify unavailable. */
GPGVERIFY_UNAVAILABLE,
+
+ /** The unsigned. */
UNSIGNED,
+
+ /** The unknown signature type. */
UNKNOWN_SIGNATURE_TYPE,
+
+ /** The no user. */
NO_USER,
+
+ /** The unverified email. */
UNVERIFIED_EMAIL,
+
+ /** The bad email. */
BAD_EMAIL,
+
+ /** The unknown key. */
UNKNOWN_KEY,
+
+ /** The malformed signature. */
MALFORMED_SIGNATURE,
+
+ /** The invalid. */
INVALID,
+
+ /** The valid. */
VALID
}
}
diff --git a/src/main/java/org/kohsuke/github/GHVerifiedKey.java b/src/main/java/org/kohsuke/github/GHVerifiedKey.java
index 24dfbdbfa0..0d0ee4057f 100644
--- a/src/main/java/org/kohsuke/github/GHVerifiedKey.java
+++ b/src/main/java/org/kohsuke/github/GHVerifiedKey.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* The type GHVerifiedKey.
*/
@@ -12,6 +13,11 @@ public GHVerifiedKey() {
this.verified = true;
}
+ /**
+ * Gets the title.
+ *
+ * @return the title
+ */
@Override
public String getTitle() {
return (title == null ? "key-" + id : title);
diff --git a/src/main/java/org/kohsuke/github/GHWorkflow.java b/src/main/java/org/kohsuke/github/GHWorkflow.java
index 752982e098..b016e5d6bc 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflow.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflow.java
@@ -10,6 +10,7 @@
import java.util.Map;
import java.util.Objects;
+// TODO: Auto-generated Javadoc
/**
* A workflow.
*
@@ -56,6 +57,13 @@ public String getState() {
return state;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
return GitHubClient.parseURL(htmlUrl);
@@ -155,6 +163,13 @@ private String getApiRoute() {
return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/workflows/" + getId();
}
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH workflow
+ */
GHWorkflow wrapUp(GHRepository owner) {
this.owner = owner;
return this;
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJob.java b/src/main/java/org/kohsuke/github/GHWorkflowJob.java
index 710930e740..82a487d72f 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowJob.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowJob.java
@@ -17,6 +17,7 @@
import static java.util.Objects.requireNonNull;
+// TODO: Auto-generated Javadoc
/**
* A workflow run job.
*
@@ -72,7 +73,7 @@ public String getHeadSha() {
}
/**
- * When was this job started?
+ * When was this job started?.
*
* @return start date
*/
@@ -81,7 +82,7 @@ public Date getStartedAt() {
}
/**
- * When was this job completed?
+ * When was this job completed?.
*
* @return completion date
*/
@@ -129,6 +130,11 @@ public int getRunAttempt() {
return runAttempt;
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ */
@Override
public URL getHtmlUrl() {
return GitHubClient.parseURL(htmlUrl);
@@ -216,9 +222,9 @@ public GHRepository getRepository() {
* the type of result
* @param streamFunction
* The {@link InputStreamFunction} that will process the stream
+ * @return the result of reading the stream.
* @throws IOException
* The IO exception.
- * @return the result of reading the stream.
*/
public T downloadLogs(InputStreamFunction streamFunction) throws IOException {
requireNonNull(streamFunction, "Stream function must not be null");
@@ -236,11 +242,21 @@ private String getApiRoute() {
return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/jobs/" + getId();
}
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH workflow job
+ */
GHWorkflowJob wrapUp(GHRepository owner) {
this.owner = owner;
return this;
}
+ /**
+ * The Class Step.
+ */
public static class Step {
private String name;
@@ -271,7 +287,7 @@ public int getNumber() {
}
/**
- * When was this step started?
+ * When was this step started?.
*
* @return start date
*/
@@ -280,7 +296,7 @@ public Date getStartedAt() {
}
/**
- * When was this step completed?
+ * When was this step completed?.
*
* @return completion date
*/
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java b/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java
index bf76957423..f9ff3a1e3e 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowJobQueryBuilder.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Lists up jobs of a workflow run with some filtering.
*
@@ -8,6 +9,12 @@
public class GHWorkflowJobQueryBuilder extends GHQueryBuilder {
private final GHRepository repo;
+ /**
+ * Instantiates a new GH workflow job query builder.
+ *
+ * @param workflowRun
+ * the workflow run
+ */
GHWorkflowJobQueryBuilder(GHWorkflowRun workflowRun) {
super(workflowRun.getRepository().root());
this.repo = workflowRun.getRepository();
@@ -34,6 +41,11 @@ public GHWorkflowJobQueryBuilder all() {
return this;
}
+ /**
+ * List.
+ *
+ * @return the paged iterable
+ */
@Override
public PagedIterable list() {
return new GHWorkflowJobsIterable(repo, req.build());
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java b/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java
index 0135e26b35..6ab751850d 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java
@@ -4,6 +4,7 @@
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* Iterable for workflow run jobs listing.
*/
@@ -13,11 +14,26 @@ class GHWorkflowJobsIterable extends PagedIterable {
private GHWorkflowJobsPage result;
+ /**
+ * Instantiates a new GH workflow jobs iterable.
+ *
+ * @param repo
+ * the repo
+ * @param request
+ * the request
+ */
public GHWorkflowJobsIterable(GHRepository repo, GitHubRequest request) {
this.repo = repo;
this.request = request;
}
+ /**
+ * Iterator.
+ *
+ * @param pageSize
+ * the page size
+ * @return the paged iterator
+ */
@Nonnull
@Override
public PagedIterator _iterator(int pageSize) {
@@ -26,6 +42,13 @@ public PagedIterator _iterator(int pageSize) {
null);
}
+ /**
+ * Adapt.
+ *
+ * @param base
+ * the base
+ * @return the iterator
+ */
protected Iterator adapt(final Iterator base) {
return new Iterator() {
public boolean hasNext() {
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java b/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java
index 6371d3663d..f19e30a2fb 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java
@@ -1,5 +1,6 @@
package org.kohsuke.github;
+// TODO: Auto-generated Javadoc
/**
* Represents the one page of jobs result when listing jobs from a workflow run.
*/
@@ -7,10 +8,22 @@ class GHWorkflowJobsPage {
private int total_count;
private GHWorkflowJob[] jobs;
+ /**
+ * Gets the total count.
+ *
+ * @return the total count
+ */
public int getTotalCount() {
return total_count;
}
+ /**
+ * Gets the workflow jobs.
+ *
+ * @param repo
+ * the repo
+ * @return the workflow jobs
+ */
GHWorkflowJob[] getWorkflowJobs(GHRepository repo) {
for (GHWorkflowJob job : jobs) {
job.wrapUp(repo);
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRun.java b/src/main/java/org/kohsuke/github/GHWorkflowRun.java
index d13bd9dc02..3ca37af8ed 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowRun.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowRun.java
@@ -17,6 +17,7 @@
import static java.util.Objects.requireNonNull;
+// TODO: Auto-generated Javadoc
/**
* A workflow run.
*
@@ -92,7 +93,7 @@ public long getRunAttempt() {
}
/**
- * When was this run triggered?
+ * When was this run triggered?.
*
* @return run triggered
* @throws IOException
@@ -102,6 +103,13 @@ public Date getRunStartedAt() throws IOException {
return GitHubClient.parseDate(runStartedAt);
}
+ /**
+ * Gets the html url.
+ *
+ * @return the html url
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
@Override
public URL getHtmlUrl() throws IOException {
return GitHubClient.parseURL(htmlUrl);
@@ -299,6 +307,16 @@ public void rerun() throws IOException {
root().createRequest().method("POST").withUrlPath(getApiRoute(), "rerun").send();
}
+ /**
+ * Approve the workflow run.
+ *
+ * @throws IOException
+ * the io exception
+ */
+ public void approve() throws IOException {
+ root().createRequest().method("POST").withUrlPath(getApiRoute(), "approve").send();
+ }
+
/**
* Lists the artifacts attached to this workflow run.
*
@@ -319,9 +337,9 @@ public PagedIterable listArtifacts() {
* the type of result
* @param streamFunction
* The {@link InputStreamFunction} that will process the stream
+ * @return the result of reading the stream.
* @throws IOException
* The IO exception.
- * @return the result of reading the stream.
*/
public T downloadLogs(InputStreamFunction streamFunction) throws IOException {
requireNonNull(streamFunction, "Stream function must not be null");
@@ -367,11 +385,25 @@ private String getApiRoute() {
return "/repos/" + owner.getOwnerName() + "/" + owner.getName() + "/actions/runs/" + getId();
}
+ /**
+ * Wrap up.
+ *
+ * @param owner
+ * the owner
+ * @return the GH workflow run
+ */
GHWorkflowRun wrapUp(GHRepository owner) {
this.owner = owner;
return wrapUp(owner.root());
}
+ /**
+ * Wrap up.
+ *
+ * @param root
+ * the root
+ * @return the GH workflow run
+ */
GHWorkflowRun wrapUp(GitHub root) {
if (owner != null) {
if (pullRequests != null) {
@@ -383,6 +415,9 @@ GHWorkflowRun wrapUp(GitHub root) {
return this;
}
+ /**
+ * The Class HeadCommit.
+ */
public static class HeadCommit {
private String id;
private String treeId;
@@ -392,7 +427,7 @@ public static class HeadCommit {
private GitUser committer;
/**
- * Gets id of the commit
+ * Gets id of the commit.
*
* @return id of the commit
*/
@@ -446,26 +481,82 @@ public GitUser getCommitter() {
}
}
+ /**
+ * The Enum Status.
+ */
public static enum Status {
- QUEUED, IN_PROGRESS, COMPLETED, UNKNOWN;
+ /** The queued. */
+ QUEUED,
+ /** The in progress. */
+ IN_PROGRESS,
+ /** The completed. */
+ COMPLETED,
+ /** The unknown. */
+ UNKNOWN;
+
+ /**
+ * From.
+ *
+ * @param value
+ * the value
+ * @return the status
+ */
public static Status from(String value) {
return EnumUtils.getNullableEnumOrDefault(Status.class, value, Status.UNKNOWN);
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return name().toLowerCase(Locale.ROOT);
}
}
+ /**
+ * The Enum Conclusion.
+ */
public static enum Conclusion {
- ACTION_REQUIRED, CANCELLED, FAILURE, NEUTRAL, SUCCESS, SKIPPED, STALE, TIMED_OUT, UNKNOWN;
+ /** The action required. */
+ ACTION_REQUIRED,
+ /** The cancelled. */
+ CANCELLED,
+ /** The failure. */
+ FAILURE,
+ /** The neutral. */
+ NEUTRAL,
+ /** The success. */
+ SUCCESS,
+ /** The skipped. */
+ SKIPPED,
+ /** The stale. */
+ STALE,
+ /** The timed out. */
+ TIMED_OUT,
+ /** The unknown. */
+ UNKNOWN;
+
+ /**
+ * From.
+ *
+ * @param value
+ * the value
+ * @return the conclusion
+ */
public static Conclusion from(String value) {
return EnumUtils.getNullableEnumOrDefault(Conclusion.class, value, Conclusion.UNKNOWN);
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return name().toLowerCase(Locale.ROOT);
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java b/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java
index 57a482d1bf..d1daaf929d 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowRunQueryBuilder.java
@@ -1,7 +1,9 @@
package org.kohsuke.github;
+import org.kohsuke.github.GHWorkflowRun.Conclusion;
import org.kohsuke.github.GHWorkflowRun.Status;
+// TODO: Auto-generated Javadoc
/**
* Lists up workflow runs with some filtering and sorting.
*
@@ -11,6 +13,12 @@
public class GHWorkflowRunQueryBuilder extends GHQueryBuilder {
private final GHRepository repo;
+ /**
+ * Instantiates a new GH workflow run query builder.
+ *
+ * @param repo
+ * the repo
+ */
GHWorkflowRunQueryBuilder(GHRepository repo) {
super(repo.root());
this.repo = repo;
@@ -88,6 +96,25 @@ public GHWorkflowRunQueryBuilder status(Status status) {
return this;
}
+ /**
+ * Conclusion workflow run query builder.
+ *
+ * The GitHub API is also using the status field to search by conclusion.
+ *
+ * @param conclusion
+ * the conclusion
+ * @return the gh workflow run query builder
+ */
+ public GHWorkflowRunQueryBuilder conclusion(Conclusion conclusion) {
+ req.with("status", conclusion.toString());
+ return this;
+ }
+
+ /**
+ * List.
+ *
+ * @return the paged iterable
+ */
@Override
public PagedIterable list() {
return new GHWorkflowRunsIterable(repo, req.withUrlPath(repo.getApiTailUrl("actions/runs")));
diff --git a/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java b/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java
index 5c49ad50ab..4a525a83dc 100644
--- a/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java
+++ b/src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java
@@ -4,6 +4,7 @@
import javax.annotation.Nonnull;
+// TODO: Auto-generated Javadoc
/**
* Iterable for workflow runs listing.
*/
@@ -13,11 +14,26 @@ class GHWorkflowRunsIterable extends PagedIterable {
private GHWorkflowRunsPage result;
+ /**
+ * Instantiates a new GH workflow runs iterable.
+ *
+ * @param owner
+ * the owner
+ * @param requestBuilder
+ * the request builder
+ */
public GHWorkflowRunsIterable(GHRepository owner, GitHubRequest.Builder> requestBuilder) {
this.owner = owner;
this.request = requestBuilder.build();
}
+ /**
+ * Iterator.
+ *
+ * @param pageSize
+ * the page size
+ * @return the paged iterator
+ */
@Nonnull
@Override
public PagedIterator