Class GHRateLimit

java.lang.Object
org.kohsuke.github.GHRateLimit

public class GHRateLimit extends Object
Rate limit.
Author:
Liam Newman
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A rate limit record.
    static class 
    A limit record used as a placeholder when the actual limit is not known.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Deprecated.
    This field should never have been made public.
    int
    Deprecated.
    This field should never have been made public.
    Deprecated.
    This field should never have been made public.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Equals.
    The core object provides the rate limit status for all non-search-related resources in the REST API.
    The graphql record provides the rate limit status for the GraphQL API.
    The integration manifest record provides the rate limit status for the GitHub App Manifest code conversion endpoint.
    int
    Gets the total number of Core API calls per hour allotted for this connection.
    int
    Gets the remaining number of Core APIs requests allowed before this connection will be throttled.
    Returns the date at which the Core API rate limit will reset.
    long
    Gets the time in epoch seconds when the Core API rate limit will reset.
    The search record provides the rate limit status for the Search API.
    int
    Hash code.
    boolean
    Whether the reset date for the Core API rate limit has passed.
    To string.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • 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 Details

    • 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
    • toString

      public String toString()
      To string.
      Overrides:
      toString in class Object
      Returns:
      the string
    • equals

      public boolean equals(Object o)
      Equals.
      Overrides:
      equals in class Object
      Parameters:
      o - the o
      Returns:
      true, if successful
    • hashCode

      public int hashCode()
      Hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the int