Skip to content

Commit dc897ca

Browse files
committed
Merge tag 'github-api-2.0-rc.3' into release/v2.x
github-api-2.0-rc.3
2 parents cbeec1b + 616ae3c commit dc897ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+553
-413
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.kohsuke</groupId>
55
<artifactId>${github-api.artifactId}</artifactId>
6-
<version>2.0-rc.2</version>
6+
<version>2.0-rc.3</version>
77
<name>GitHub API for Java</name>
88
<description>GitHub API for Java</description>
99
<url>https://hub4j.github.io/github-api/</url>

src/main/java/org/kohsuke/github/GHAppInstallationToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public GHAppInstallationToken() {
2323
private String token;
2424

2525
/** The expires at. */
26-
protected String expires_at;
26+
protected String expiresAt;
2727
private Map<String, String> permissions;
2828
private List<GHRepository> repositories;
2929
private GHRepositorySelection repositorySelection;
@@ -71,6 +71,6 @@ public GHRepositorySelection getRepositorySelection() {
7171
*/
7272
@WithBridgeMethods(value = Date.class, adapterMethod = "instantToDate")
7373
public Instant getExpiresAt() {
74-
return GitHubClient.parseInstant(expires_at);
74+
return GitHubClient.parseInstant(expiresAt);
7575
}
7676
}

src/main/java/org/kohsuke/github/GHAppInstallationsPage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Represents the one page of GHAppInstallations.
66
*/
77
class GHAppInstallationsPage {
8-
private int total_count;
8+
private int totalCount;
99
private GHAppInstallation[] installations;
1010

1111
/**
@@ -14,7 +14,7 @@ class GHAppInstallationsPage {
1414
* @return the total count
1515
*/
1616
public int getTotalCount() {
17-
return total_count;
17+
return totalCount;
1818
}
1919

2020
/**

src/main/java/org/kohsuke/github/GHArtifactsPage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
1010
justification = "JSON API")
1111
class GHArtifactsPage {
12-
private int total_count;
12+
private int totalCount;
1313
private GHArtifact[] artifacts;
1414

1515
/**
@@ -18,7 +18,7 @@ class GHArtifactsPage {
1818
* @return the total count
1919
*/
2020
public int getTotalCount() {
21-
return total_count;
21+
return totalCount;
2222
}
2323

2424
/**

src/main/java/org/kohsuke/github/GHAsset.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ public GHAsset() {
2323
private String name;
2424
private String label;
2525
private String state;
26-
private String content_type;
26+
private String contentType;
2727
private long size;
28-
private long download_count;
29-
private String browser_download_url;
28+
private long downloadCount;
29+
private String browserDownloadUrl;
3030

3131
/**
3232
* Gets content type.
3333
*
3434
* @return the content type
3535
*/
3636
public String getContentType() {
37-
return content_type;
37+
return contentType;
3838
}
3939

4040
/**
@@ -47,7 +47,7 @@ public String getContentType() {
4747
*/
4848
public void setContentType(String contentType) throws IOException {
4949
edit("content_type", contentType);
50-
this.content_type = contentType;
50+
this.contentType = contentType;
5151
}
5252

5353
/**
@@ -56,7 +56,7 @@ public void setContentType(String contentType) throws IOException {
5656
* @return the download count
5757
*/
5858
public long getDownloadCount() {
59-
return download_count;
59+
return downloadCount;
6060
}
6161

6262
/**
@@ -124,7 +124,7 @@ public String getState() {
124124
* @return the browser download url
125125
*/
126126
public String getBrowserDownloadUrl() {
127-
return browser_download_url;
127+
return browserDownloadUrl;
128128
}
129129

130130
private void edit(String key, Object value) throws IOException {

src/main/java/org/kohsuke/github/GHAuthorization.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ public GHAuthorization() {
7979

8080
private List<String> scopes;
8181
private String token;
82-
private String token_last_eight;
83-
private String hashed_token;
82+
private String tokenLastEight;
83+
private String hashedToken;
8484
private App app;
8585
private String note;
86-
private String note_url;
86+
private String noteUrl;
8787
private String fingerprint;
8888
// TODO add some user class for https://developer.github.com/v3/oauth_authorizations/#check-an-authorization ?
8989
// private GHUser user;
@@ -112,7 +112,7 @@ public String getToken() {
112112
* @return the token last eight
113113
*/
114114
public String getTokenLastEight() {
115-
return token_last_eight;
115+
return tokenLastEight;
116116
}
117117

118118
/**
@@ -121,7 +121,7 @@ public String getTokenLastEight() {
121121
* @return the hashed token
122122
*/
123123
public String getHashedToken() {
124-
return hashed_token;
124+
return hashedToken;
125125
}
126126

127127
/**
@@ -157,7 +157,7 @@ public String getNote() {
157157
* @return the note url
158158
*/
159159
public URL getNoteUrl() {
160-
return GitHubClient.parseURL(note_url);
160+
return GitHubClient.parseURL(noteUrl);
161161
}
162162

163163
/**

src/main/java/org/kohsuke/github/GHAutolink.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
public class GHAutolink {
1616

1717
private int id;
18-
private String key_prefix;
19-
private String url_template;
20-
private boolean is_alphanumeric;
18+
private String keyPrefix;
19+
private String urlTemplate;
20+
private boolean isAlphanumeric;
2121
private GHRepository owner;
2222

2323
/**
@@ -41,7 +41,7 @@ public int getId() {
4141
* @return the key prefix string
4242
*/
4343
public String getKeyPrefix() {
44-
return key_prefix;
44+
return keyPrefix;
4545
}
4646

4747
/**
@@ -50,7 +50,7 @@ public String getKeyPrefix() {
5050
* @return the URL template string
5151
*/
5252
public String getUrlTemplate() {
53-
return url_template;
53+
return urlTemplate;
5454
}
5555

5656
/**
@@ -59,7 +59,7 @@ public String getUrlTemplate() {
5959
* @return true if alphanumeric, false otherwise
6060
*/
6161
public boolean isAlphanumeric() {
62-
return is_alphanumeric;
62+
return isAlphanumeric;
6363
}
6464

6565
/**

src/main/java/org/kohsuke/github/GHBranch.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class GHBranch extends GitHubInteractiveObject {
2727
private Commit commit;
2828
@JsonProperty("protected")
2929
private boolean protection;
30-
private String protection_url;
30+
private String protectionUrl;
3131

3232
/**
3333
* Instantiates a new GH branch.
@@ -94,7 +94,7 @@ public boolean isProtected() {
9494
* @return API URL that deals with the protection of this branch.
9595
*/
9696
public URL getProtectionUrl() {
97-
return GitHubClient.parseURL(protection_url);
97+
return GitHubClient.parseURL(protectionUrl);
9898
}
9999

100100
/**
@@ -105,7 +105,7 @@ public URL getProtectionUrl() {
105105
* the io exception
106106
*/
107107
public GHBranchProtection getProtection() throws IOException {
108-
return root().createRequest().setRawUrlPath(protection_url).fetch(GHBranchProtection.class);
108+
return root().createRequest().setRawUrlPath(protectionUrl).fetch(GHBranchProtection.class);
109109
}
110110

111111
/**
@@ -124,7 +124,7 @@ public String getSHA1() {
124124
* if disabling protection fails
125125
*/
126126
public void disableProtection() throws IOException {
127-
root().createRequest().method("DELETE").setRawUrlPath(protection_url).send();
127+
root().createRequest().method("DELETE").setRawUrlPath(protectionUrl).send();
128128
}
129129

130130
/**

src/main/java/org/kohsuke/github/GHCheckRunBuilder.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,14 @@ public Output(@NonNull String title, @NonNull String summary) {
363363
public static final class Annotation {
364364

365365
private final String path;
366-
private final int start_line;
367-
private final int end_line;
368-
private final String annotation_level;
366+
private final int startLine;
367+
private final int endLine;
368+
private final String annotationLevel;
369369
private final String message;
370-
private Integer start_column;
371-
private Integer end_column;
370+
private Integer startColumn;
371+
private Integer endColumn;
372372
private String title;
373-
private String raw_details;
373+
private String rawDetails;
374374

375375
/**
376376
* Instantiates a new annotation.
@@ -411,9 +411,9 @@ public Annotation(@NonNull String path,
411411
@NonNull GHCheckRun.AnnotationLevel annotationLevel,
412412
@NonNull String message) {
413413
this.path = path;
414-
start_line = startLine;
415-
end_line = endLine;
416-
annotation_level = annotationLevel.toString().toLowerCase(Locale.ROOT);
414+
this.startLine = startLine;
415+
this.endLine = endLine;
416+
this.annotationLevel = annotationLevel.toString().toLowerCase(Locale.ROOT);
417417
this.message = message;
418418
}
419419

@@ -425,7 +425,7 @@ public Annotation(@NonNull String path,
425425
* @return the annotation
426426
*/
427427
public @NonNull Annotation withStartColumn(@CheckForNull Integer startColumn) {
428-
start_column = startColumn;
428+
this.startColumn = startColumn;
429429
return this;
430430
}
431431

@@ -437,7 +437,7 @@ public Annotation(@NonNull String path,
437437
* @return the annotation
438438
*/
439439
public @NonNull Annotation withEndColumn(@CheckForNull Integer endColumn) {
440-
end_column = endColumn;
440+
this.endColumn = endColumn;
441441
return this;
442442
}
443443

@@ -461,7 +461,7 @@ public Annotation(@NonNull String path,
461461
* @return the annotation
462462
*/
463463
public @NonNull Annotation withRawDetails(@CheckForNull String rawDetails) {
464-
raw_details = rawDetails;
464+
this.rawDetails = rawDetails;
465465
return this;
466466
}
467467

@@ -476,7 +476,7 @@ public Annotation(@NonNull String path,
476476
public static final class Image {
477477

478478
private final String alt;
479-
private final String image_url;
479+
private final String imageUrl;
480480
private String caption;
481481

482482
/**
@@ -489,7 +489,7 @@ public static final class Image {
489489
*/
490490
public Image(@NonNull String alt, @NonNull String imageURL) {
491491
this.alt = alt;
492-
image_url = imageURL;
492+
this.imageUrl = imageURL;
493493
}
494494

495495
/**

src/main/java/org/kohsuke/github/GHCheckRunsPage.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
1010
justification = "JSON API")
1111
class GHCheckRunsPage {
12-
private int total_count;
13-
private GHCheckRun[] check_runs;
12+
private int totalCount;
13+
private GHCheckRun[] checkRuns;
1414

1515
/**
1616
* Gets the total count.
1717
*
1818
* @return the total count
1919
*/
2020
public int getTotalCount() {
21-
return total_count;
21+
return totalCount;
2222
}
2323

2424
/**
@@ -29,9 +29,9 @@ public int getTotalCount() {
2929
* @return the check runs
3030
*/
3131
GHCheckRun[] getCheckRuns(GHRepository owner) {
32-
for (GHCheckRun check_run : check_runs) {
33-
check_run.wrap(owner);
32+
for (GHCheckRun checkRun : checkRuns) {
33+
checkRun.wrap(owner);
3434
}
35-
return check_runs;
35+
return checkRuns;
3636
}
3737
}

src/main/java/org/kohsuke/github/GHCommentAuthorAssociation.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,9 @@ public enum GHCommentAuthorAssociation {
3838
/**
3939
* Author is the owner of the repository.
4040
*/
41-
OWNER
41+
OWNER,
42+
/**
43+
* Author association is not recognized.
44+
*/
45+
UNKNOWN
4246
}

0 commit comments

Comments
 (0)