module GitHub.Endpoints.Gists (
gists,
gists',
gistsR,
gist,
gist',
gistR,
starGist,
starGistR,
unstarGist,
unstarGistR,
deleteGist,
deleteGistR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
gists' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Gist))
gists' auth user =
executeRequestMaybe auth $ gistsR user FetchAll
gists :: Name Owner -> IO (Either Error (Vector Gist))
gists = gists' Nothing
gistsR :: Name Owner -> FetchCount -> Request k (Vector Gist)
gistsR user = pagedQuery ["users", toPathPart user, "gists"] []
gist' :: Maybe Auth -> Name Gist -> IO (Either Error Gist)
gist' auth gid =
executeRequestMaybe auth $ gistR gid
gist :: Name Gist -> IO (Either Error Gist)
gist = gist' Nothing
gistR :: Name Gist -> Request k Gist
gistR gid =
query ["gists", toPathPart gid] []
starGist :: Auth -> Name Gist -> IO (Either Error ())
starGist auth gid = executeRequest auth $ starGistR gid
starGistR :: Name Gist -> GenRequest 'MtUnit 'RW ()
starGistR gid = Command Put ["gists", toPathPart gid, "star"] mempty
unstarGist :: Auth -> Name Gist -> IO (Either Error ())
unstarGist auth gid = executeRequest auth $ unstarGistR gid
unstarGistR :: Name Gist -> GenRequest 'MtUnit 'RW ()
unstarGistR gid = Command Delete ["gists", toPathPart gid, "star"] mempty
deleteGist :: Auth -> Name Gist -> IO (Either Error ())
deleteGist auth gid = executeRequest auth $ deleteGistR gid
deleteGistR :: Name Gist -> GenRequest 'MtUnit 'RW ()
deleteGistR gid = Command Delete ["gists", toPathPart gid] mempty