File tree Expand file tree Collapse file tree
src/main/java/org/kohsuke/github Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .kohsuke .github ;
22
3+ import java .util .Date ;
4+
35/**
46 * Rate limit.
57 * @author Kohsuke Kawaguchi
@@ -10,12 +12,28 @@ public class GHRateLimit {
1012 */
1113 public int remaining ;
1214 /**
13- * Alotted API call per hour.
15+ * Allotted API call per hour.
1416 */
1517 public int limit ;
1618
19+ /**
20+ * The time at which the current rate limit window resets in UTC epoch seconds.
21+ */
22+ public Date reset ;
23+
24+ /**
25+ * Non-epoch date
26+ */
27+ public Date getResetDate () {
28+ return new Date (reset .getTime () * 1000 );
29+ }
30+
1731 @ Override
1832 public String toString () {
19- return remaining +"/" +limit ;
33+ return "GHRateLimit{" +
34+ "remaining=" + remaining +
35+ ", limit=" + limit +
36+ ", resetDate=" + getResetDate () +
37+ '}' ;
2038 }
2139}
You can’t perform that action at this time.
0 commit comments