Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
50 changes: 25 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -418,37 +418,37 @@
</limits>
<excludes>
<!-- V2.x changes -->
<exclude>org.kohsuke.github.GHRepositorySearchBuilder.Fork</exclude>
<exclude>org.kohsuke.github_api.v2.GHRepositorySearchBuilder.Fork</exclude>

<!-- Sample only -->
<exclude>org.kohsuke.github.example.*</exclude>
<exclude>org.kohsuke.github_api.v2.example.*</exclude>

<!-- Unbridged test changes -->
<exclude>org.kohsuke.github.GHCommit.GHAuthor</exclude>
<exclude>org.kohsuke.github_api.v2.GHCommit.GHAuthor</exclude>

<!-- TODO: Some coverage, but more needed -->
<exclude>org.kohsuke.github.GHIssue.PullRequest</exclude>
<exclude>org.kohsuke.github.GHCommitSearchBuilder</exclude>
<exclude>org.kohsuke.github.GHRepositorySearchBuilder</exclude>
<exclude>org.kohsuke.github.GHUserSearchBuilder</exclude>
<exclude>org.kohsuke.github_api.v2.GHIssue.PullRequest</exclude>
<exclude>org.kohsuke.github_api.v2.GHCommitSearchBuilder</exclude>
<exclude>org.kohsuke.github_api.v2.GHRepositorySearchBuilder</exclude>
<exclude>org.kohsuke.github_api.v2.GHUserSearchBuilder</exclude>

<!-- TODO: These still need test coverage -->
<exclude>org.kohsuke.github.GHBranchProtection.RequiredSignatures</exclude>
<exclude>org.kohsuke.github.GHBranchProtectionBuilder.Restrictions</exclude>
<exclude>org.kohsuke.github.GHBranchProtection.Restrictions</exclude>
<exclude>org.kohsuke.github.GHCommentAuthorAssociation</exclude>
<exclude>org.kohsuke.github.GHDeployKey</exclude>
<exclude>org.kohsuke.github.GHEmail</exclude>
<exclude>org.kohsuke.github.GHInvitation</exclude>
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.Authorship</exclude>
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.Commit</exclude>
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.CommitPointer</exclude>
<exclude>org.kohsuke.github.GHPullRequestCommitDetail.Tree</exclude>
<exclude>org.kohsuke.github.GHPullRequestCommitDetail</exclude>
<exclude>org.kohsuke.github.GHPullRequestFileDetail</exclude>
<exclude>org.kohsuke.github.GHReleaseUpdater</exclude>
<exclude>org.kohsuke.github.GHRequestedAction</exclude>
<exclude>org.kohsuke.github.GHVerifiedKey</exclude>
<exclude>org.kohsuke.github_api.v2.GHBranchProtection.RequiredSignatures</exclude>
<exclude>org.kohsuke.github_api.v2.GHBranchProtectionBuilder.Restrictions</exclude>
<exclude>org.kohsuke.github_api.v2.GHBranchProtection.Restrictions</exclude>
<exclude>org.kohsuke.github_api.v2.GHCommentAuthorAssociation</exclude>
<exclude>org.kohsuke.github_api.v2.GHDeployKey</exclude>
<exclude>org.kohsuke.github_api.v2.GHEmail</exclude>
<exclude>org.kohsuke.github_api.v2.GHInvitation</exclude>
<exclude>org.kohsuke.github_api.v2.GHPullRequestCommitDetail.Authorship</exclude>
<exclude>org.kohsuke.github_api.v2.GHPullRequestCommitDetail.Commit</exclude>
<exclude>org.kohsuke.github_api.v2.GHPullRequestCommitDetail.CommitPointer</exclude>
<exclude>org.kohsuke.github_api.v2.GHPullRequestCommitDetail.Tree</exclude>
<exclude>org.kohsuke.github_api.v2.GHPullRequestCommitDetail</exclude>
<exclude>org.kohsuke.github_api.v2.GHPullRequestFileDetail</exclude>
<exclude>org.kohsuke.github_api.v2.GHReleaseUpdater</exclude>
<exclude>org.kohsuke.github_api.v2.GHRequestedAction</exclude>
<exclude>org.kohsuke.github_api.v2.GHVerifiedKey</exclude>
</excludes>
</rule>
</rules>
Expand Down Expand Up @@ -544,7 +544,7 @@
<includeSynthetic>true</includeSynthetic>
<excludes>
<!-- Classes in internal are public but are considered private for API stability purposes -->
<exclude>org.kohsuke.github.internal</exclude>
<exclude>org.kohsuke.github_api.v2.internal</exclude>
</excludes>
</parameter>
</configuration>
Expand Down Expand Up @@ -606,7 +606,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>org.kohsuke.github.api</Automatic-Module-Name>
<Automatic-Module-Name>org.kohsuke.github_api.v2.api</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
21 changes: 2 additions & 19 deletions src/main/java/org/kohsuke/github/GHApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import java.io.IOException;
import java.net.URL;
import java.time.Instant;
import java.util.Collections;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -222,7 +221,7 @@ public PagedIterable<GHAppInstallationRequest> listInstallationRequests() {
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
*/
public PagedIterable<GHAppInstallation> listInstallations() {
return listInstallations(GitHubClient.toInstantOrNull(null));
return listInstallations(null);
}

/**
Expand All @@ -234,27 +233,11 @@ public PagedIterable<GHAppInstallation> listInstallations() {
* - Allows users to get installations that have been updated since a given date.
* @return a list of App installations since a given time.
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
* @deprecated use {@link #listInstallations(Instant)}
*/
@Deprecated
public PagedIterable<GHAppInstallation> listInstallations(final Date since) {
return listInstallations(since.toInstant());
}

/**
* Obtains all the installations associated with this app since a given date.
* <p>
* You must use a JWT to access this endpoint.
*
* @param since
* - Allows users to get installations that have been updated since a given date.
* @return a list of App installations since a given time.
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
*/
public PagedIterable<GHAppInstallation> listInstallations(final Instant since) {
Requester requester = root().createRequest().withUrlPath("/app/installations");
if (since != null) {
requester.with("since", GitHubClient.printInstant(since));
requester.with("since", GitHubClient.printDate(since));
}
return requester.toIterable(GHAppInstallation[].class, null);
}
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/kohsuke/github/GHAppInstallation.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.kohsuke.github;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.internal.EnumUtils;

import java.io.IOException;
import java.net.URL;
import java.time.Instant;
import java.util.Collections;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -217,9 +215,8 @@ public String getSingleFileName() {
*
* @return the suspended at
*/
@WithBridgeMethods(value = Date.class, adapterMethod = "instantToDate")
public Instant getSuspendedAt() {
return GitHubClient.parseInstant(suspendedAt);
public Date getSuspendedAt() {
return GitHubClient.parseDate(suspendedAt);
}

/**
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/kohsuke/github/GHAppInstallationToken.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.kohsuke.github;

import com.infradna.tool.bridge_method_injector.WithBridgeMethods;

import java.time.Instant;
import java.util.*;

// TODO: Auto-generated Javadoc
Expand All @@ -21,7 +18,7 @@ public class GHAppInstallationToken extends GitHubInteractiveObject {
private GHRepositorySelection repositorySelection;
private String token;
/** The expires at. */
protected String expiresAt;
protected String expires_at;
/**
* Create default GHAppInstallationToken instance
*/
Expand All @@ -33,9 +30,8 @@ public GHAppInstallationToken() {
*
* @return date when this token expires
*/
@WithBridgeMethods(value = Date.class, adapterMethod = "instantToDate")
public Instant getExpiresAt() {
return GitHubClient.parseInstant(expiresAt);
public Date getExpiresAt() {
return GitHubClient.parseDate(expires_at);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHAppInstallationsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
*/
class GHAppInstallationsPage {
private GHAppInstallation[] installations;
private int totalCount;
private int total_count;

/**
* Gets the total count.
*
* @return the total count
*/
public int getTotalCount() {
return totalCount;
return total_count;
}

/**
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/kohsuke/github/GHArtifact.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package org.kohsuke.github;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.function.InputStreamFunction;

import java.io.IOException;
import java.net.URL;
import java.time.Instant;
import java.util.Date;
import java.util.Objects;

Expand Down Expand Up @@ -79,9 +77,8 @@ public URL getArchiveDownloadUrl() {
*
* @return the date of expiration
*/
@WithBridgeMethods(value = Date.class, adapterMethod = "instantToDate")
public Instant getExpiresAt() {
return GitHubClient.parseInstant(expiresAt);
public Date getExpiresAt() {
return GitHubClient.parseDate(expiresAt);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHArtifactsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
justification = "JSON API")
class GHArtifactsPage {
private GHArtifact[] artifacts;
private int totalCount;
private int total_count;

/**
* Gets the total count.
*
* @return the total count
*/
public int getTotalCount() {
return totalCount;
return total_count;
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/kohsuke/github/GHAsset.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public static GHAsset[] wrap(GHAsset[] assets, GHRelease release) {
return assets;
}

private String browserDownloadUrl;
private String contentType;
private long downloadCount;
private String browser_download_url;
private String content_type;
private long download_count;
private String label;
private String name;
private long size;
Expand Down Expand Up @@ -60,7 +60,7 @@ public void delete() throws IOException {
* @return the browser download url
*/
public String getBrowserDownloadUrl() {
return browserDownloadUrl;
return browser_download_url;
}

/**
Expand All @@ -69,7 +69,7 @@ public String getBrowserDownloadUrl() {
* @return the content type
*/
public String getContentType() {
return contentType;
return content_type;
}

/**
Expand All @@ -78,7 +78,7 @@ public String getContentType() {
* @return the download count
*/
public long getDownloadCount() {
return downloadCount;
return download_count;
}

/**
Expand Down Expand Up @@ -137,7 +137,7 @@ public String getState() {
*/
public void setContentType(String contentType) throws IOException {
edit("content_type", contentType);
this.contentType = contentType;
this.content_type = contentType;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/kohsuke/github/GHAuthorization.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ private static class App {
private String fingerprint;
// TODO add some user class for https://developer.github.com/v3/oauth_authorizations/#check-an-authorization ?
// private GHUser user;
private String hashedToken;
private String hashed_token;
private String note;
private String noteUrl;
private String note_url;
private List<String> scopes;
private String token;
private String tokenLastEight;
private String token_last_eight;

/**
* Create default GHAuthorization instance
Expand Down Expand Up @@ -129,7 +129,7 @@ public String getFingerprint() {
* @return the hashed token
*/
public String getHashedToken() {
return hashedToken;
return hashed_token;
}

/**
Expand All @@ -147,7 +147,7 @@ public String getNote() {
* @return the note url
*/
public URL getNoteUrl() {
return GitHubClient.parseURL(noteUrl);
return GitHubClient.parseURL(note_url);
}

/**
Expand All @@ -174,6 +174,6 @@ public String getToken() {
* @return the token last eight
*/
public String getTokenLastEight() {
return tokenLastEight;
return token_last_eight;
}
}
12 changes: 6 additions & 6 deletions src/main/java/org/kohsuke/github/GHAutolink.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
public class GHAutolink {

private int id;
private boolean isAlphanumeric;
private String keyPrefix;
private boolean is_alphanumeric;
private String key_prefix;
private GHRepository owner;
private String urlTemplate;
private String url_template;

/**
* Instantiates a new Gh autolink.
Expand Down Expand Up @@ -55,7 +55,7 @@ public int getId() {
* @return the key prefix string
*/
public String getKeyPrefix() {
return keyPrefix;
return key_prefix;
}

/**
Expand All @@ -74,7 +74,7 @@ public GHRepository getOwner() {
* @return the URL template string
*/
public String getUrlTemplate() {
return urlTemplate;
return url_template;
}

/**
Expand All @@ -83,7 +83,7 @@ public String getUrlTemplate() {
* @return true if alphanumeric, false otherwise
*/
public boolean isAlphanumeric() {
return isAlphanumeric;
return is_alphanumeric;
}

/**
Expand Down
Loading
Loading