module GitHub.Endpoints.GitData.References (
reference,
reference',
referenceR,
references,
references',
referencesR,
createReference,
createReferenceR,
namespacedReferences,
module GitHub.Data,
) where
import Data.Aeson.Compat (encode)
import Data.Vector (Vector)
import GitHub.Data
import GitHub.Request
reference' :: Maybe Auth -> Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)
reference' auth user repo ref =
executeRequestMaybe auth $ referenceR user repo ref
reference :: Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)
reference = reference' Nothing
referenceR :: Name Owner -> Name Repo -> Name GitReference -> Request k GitReference
referenceR user repo ref =
Query ["repos", toPathPart user, toPathPart repo, "git", "refs", toPathPart ref] []
references' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))
references' auth user repo =
executeRequestMaybe auth $ referencesR user repo Nothing
references :: Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))
references = references' Nothing
referencesR :: Name Owner -> Name Repo -> Maybe Count -> Request k (Vector GitReference)
referencesR user repo =
PagedQuery ["repos", toPathPart user, toPathPart repo, "git", "refs"] []
createReference :: Auth -> Name Owner -> Name Repo -> NewGitReference -> IO (Either Error GitReference)
createReference auth user repo newRef =
executeRequest auth $ createReferenceR user repo newRef
createReferenceR :: Name Owner -> Name Repo -> NewGitReference -> Request 'True GitReference
createReferenceR user repo newRef =
Command Post ["repos", toPathPart user, toPathPart repo , "git", "refs"] (encode newRef)
namespacedReferences :: Name Owner -> Name Repo -> String -> IO (Either Error [GitReference])
namespacedReferences user repo namespace =
executeRequest' $ namespacedReferencesR user repo namespace
namespacedReferencesR :: Name Owner -> Name Repo -> String -> Request k [GitReference]
namespacedReferencesR user repo namespace =
Query ["repos", toPathPart user, toPathPart repo, "git", "refs", namespace] []