-----------------------------------------------------------------------------
-- |
-- License     :  BSD-3-Clause
-- Maintainer  :  Oleg Grenrus <oleg.grenrus@iki.fi>
--
-- The Github RateLimit API, as described at
-- <http://developer.github.com/v3/rate_limit/>.
module GitHub.Endpoints.RateLimit (
    rateLimitR,
    rateLimit,
    rateLimit',
    module GitHub.Data,
    ) where

import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()

-- | Get your current rate limit status (Note: Accessing this endpoint does not count against your rate limit.)
-- With authentication.
rateLimit' :: Maybe Auth -> IO (Either Error RateLimit)
rateLimit' :: Maybe Auth -> IO (Either Error RateLimit)
rateLimit' auth :: Maybe Auth
auth = Maybe Auth
-> GenRequest 'MtJSON 'RO RateLimit -> IO (Either Error RateLimit)
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth GenRequest 'MtJSON 'RO RateLimit
forall (k :: RW). Request k RateLimit
rateLimitR

-- | Get your current rate limit status (Note: Accessing this endpoint does not count against your rate limit.)
-- Without authentication.
rateLimit :: IO (Either Error RateLimit)
rateLimit :: IO (Either Error RateLimit)
rateLimit = Maybe Auth -> IO (Either Error RateLimit)
rateLimit' Maybe Auth
forall a. Maybe a
Nothing

-- | Get your current rate limit status.
-- <https://developer.github.com/v3/rate_limit/#get-your-current-rate-limit-status>
rateLimitR :: Request k RateLimit
rateLimitR :: Request k RateLimit
rateLimitR = Paths -> QueryString -> Request k RateLimit
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["rate_limit"] []