module GitHub.Endpoints.GitData.References (
reference,
reference',
referenceR,
references,
references',
referencesR,
createReference,
createReferenceR,
namespacedReferences,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
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 FetchAll
references :: Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))
references = references' Nothing
referencesR :: Name Owner -> Name Repo -> FetchCount -> 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 'RW GitReference
createReferenceR user repo newRef =
command Post ["repos", toPathPart user, toPathPart repo , "git", "refs"] (encode newRef)
namespacedReferences :: Name Owner -> Name Repo -> Text -> IO (Either Error [GitReference])
namespacedReferences user repo namespace =
executeRequest' $ namespacedReferencesR user repo namespace
namespacedReferencesR :: Name Owner -> Name Repo -> Text -> Request k [GitReference]
namespacedReferencesR user repo namespace =
query ["repos", toPathPart user, toPathPart repo, "git", "refs", namespace] []