-- |
-- The Github Users API, as described at
-- <http://developer.github.com/v3/users/>.

module GitHub.Endpoints.Users (
    userInfoForR,
    ownerInfoForR,
    userInfoCurrentR,
    module GitHub.Data,
    ) where

import GitHub.Data
import Prelude ()

-- | Query a single user.
-- See <https://developer.github.com/v3/users/#get-a-single-user>
--
-- >>> github' userInfoForR "mike-burns"
--
-- or
--
-- >>> github userInfoForR (OAuth "github-token") "mike-burns"
--
userInfoForR :: Name User -> Request k User
userInfoForR :: forall (k :: RW). Name User -> Request k User
userInfoForR Name User
user = forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"users", forall a. IsPathPart a => a -> Text
toPathPart Name User
user] []

-- | Query a single user or an organization.
-- See <https://developer.github.com/v3/users/#get-a-single-user>
ownerInfoForR :: Name Owner -> Request k Owner
ownerInfoForR :: forall (k :: RW). Name Owner -> Request k Owner
ownerInfoForR Name Owner
owner = forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"users", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
owner] []

-- | Query the authenticated user.
-- See <https://developer.github.com/v3/users/#get-the-authenticated-user>
userInfoCurrentR :: Request 'RA User
userInfoCurrentR :: Request 'RA User
userInfoCurrentR = forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"user"] []