Package org.kohsuke.github
Class GHRateLimit
- java.lang.Object
-
- org.kohsuke.github.GHRateLimit
-
public class GHRateLimit extends Object
Rate limit.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHRateLimit.RecordA rate limit record.static classGHRateLimit.UnknownLimitRecordA limit record used as a placeholder when the the actual limit is not known.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)GHRateLimit.RecordgetCore()The core object provides the rate limit status for all non-search-related resources in the REST API.GHRateLimit.RecordgetGraphQL()The graphql record provides the rate limit status for the GraphQL API.GHRateLimit.RecordgetIntegrationManifest()The integration manifest record provides the rate limit status for the GitHub App Manifest code conversion endpoint.intgetLimit()Gets the total number of Core API calls per hour allotted for this connection.intgetRemaining()Gets the remaining number of Core APIs requests allowed before this connection will be throttled.DategetResetDate()Returns the date at which the Core API rate limit will reset.longgetResetEpochSeconds()Gets the time in epoch seconds when the Core API rate limit will reset.GHRateLimit.RecordgetSearch()The search record provides the rate limit status for the Search API.inthashCode()booleanisExpired()Whether the reset date for the Core API rate limit has passed.StringtoString()
-
-
-
Field Detail
-
remaining
@Deprecated public int remaining
Deprecated.This field should never have been made public. UsegetRemaining()Remaining calls that can be made.
-
limit
@Deprecated public int limit
Deprecated.This field should never have been made public. UsegetLimit()Allotted API call per hour.
-
reset
@Deprecated public Date reset
Deprecated.This field should never have been made public. UsegetResetDate()The time at which the current rate limit window resets in UTC epoch seconds. WARNING: this field was implemented usingDate(long)which expects UTC epoch milliseconds, so this Date instance is meaningless as a date. To use this field in any meaningful way, it must be converted to a long usingDate.getTime()multiplied by 1000.
-
-
Method Detail
-
getResetDate
@Nonnull public Date getResetDate()
Returns the date at which the Core API rate limit will reset.- Returns:
- the calculated date at which the rate limit has or will reset.
-
getRemaining
public int getRemaining()
Gets the remaining number of Core APIs requests allowed before this connection will be throttled.- Returns:
- an integer
- Since:
- 1.100
-
getLimit
public int getLimit()
Gets the total number of Core API calls per hour allotted for this connection.- Returns:
- an integer
- Since:
- 1.100
-
getResetEpochSeconds
public long getResetEpochSeconds()
Gets the time in epoch seconds when the Core API rate limit will reset.- Returns:
- a long
- Since:
- 1.100
-
isExpired
public boolean isExpired()
Whether the reset date for the Core API rate limit has passed.- Returns:
- true if the rate limit reset date has passed. Otherwise false.
- Since:
- 1.100
-
getCore
@Nonnull public GHRateLimit.Record getCore()
The core object provides the rate limit status for all non-search-related resources in the REST API.- Returns:
- a rate limit record
- Since:
- 1.100
-
getSearch
@Nonnull public GHRateLimit.Record getSearch()
The search record provides the rate limit status for the Search API.- Returns:
- a rate limit record
- Since:
- 1.115
-
getGraphQL
@Nonnull public GHRateLimit.Record getGraphQL()
The graphql record provides the rate limit status for the GraphQL API.- Returns:
- a rate limit record
- Since:
- 1.115
-
getIntegrationManifest
@Nonnull public GHRateLimit.Record getIntegrationManifest()
The integration manifest record provides the rate limit status for the GitHub App Manifest code conversion endpoint.- Returns:
- a rate limit record
- Since:
- 1.115
-
-