RateLimit

data class RateLimit(    val limit: Int,     val remaining: Int,     val resetAt: GMTDate)

Represents Twitter API rate limit.

Constructors

Link copied to clipboard
fun RateLimit(    limit: Int,     remaining: Int,     resetAt: GMTDate)

Properties

Link copied to clipboard
val limit: Int

Endpoint max limit in 15 minutes.

Link copied to clipboard
val remaining: Int

Current remaining for endpoint.

Link copied to clipboard
val resetAt: GMTDate

Rate limit reset at.

Extensions

Link copied to clipboard
suspend fun RateLimit.awaitRefresh()

Awaits until rate limit is refreshed. (Suspending function)

Link copied to clipboard
fun RateLimit.blockUntilRefresh()

Blocks until rate limit is refreshed. (Classic blocking function)

Link copied to clipboard
val RateLimit.consumed: Int

The count you consumed in last 15 minutes.

Link copied to clipboard
val RateLimit.duration: Duration

The Duration between now and RateLimit.resetAt.

Link copied to clipboard
val RateLimit.isExceeded: Boolean

The flag indicates you may access the same endpoint more at this time. If true, rate limit exceeded.