Class GHRateLimit


  • public class GHRateLimit
    extends Object
    Rate limit.
    Author:
    Kohsuke Kawaguchi
    • Field Detail

      • remaining

        @Deprecated
        public int remaining
        Deprecated.
        This field should never have been made public. Use getRemaining()
        Remaining calls that can be made.
      • limit

        @Deprecated
        public int limit
        Deprecated.
        This field should never have been made public. Use getLimit()
        Allotted API call per hour.
      • reset

        @Deprecated
        public Date reset
        Deprecated.
        This field should never have been made public. Use getResetDate()
        The time at which the current rate limit window resets in UTC epoch seconds. WARNING: this field was implemented using Date(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 using Date.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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object