module GitHub.Endpoints.Repos.Statuses (
createStatusR,
statusesForR,
statusForR,
module GitHub.Data
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
createStatusR :: Name Owner -> Name Repo -> Name Commit -> NewStatus -> Request 'RW Status
createStatusR :: Name Owner
-> Name Repo -> Name Commit -> NewStatus -> Request 'RW Status
createStatusR Name Owner
owner Name Repo
repo Name Commit
sha =
CommandMethod -> Paths -> ByteString -> Request 'RW Status
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post Paths
parts (ByteString -> Request 'RW Status)
-> (NewStatus -> ByteString) -> NewStatus -> Request 'RW Status
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NewStatus -> ByteString
forall a. ToJSON a => a -> ByteString
encode
where
parts :: Paths
parts = [Text
"repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
owner, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"statuses", Name Commit -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Commit
sha]
statusesForR :: Name Owner -> Name Repo -> Name Commit -> FetchCount -> Request 'RW (Vector Status)
statusesForR :: Name Owner
-> Name Repo
-> Name Commit
-> FetchCount
-> Request 'RW (Vector Status)
statusesForR Name Owner
user Name Repo
repo Name Commit
sha =
Paths -> QueryString -> FetchCount -> Request 'RW (Vector Status)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"commits", Name Commit -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Commit
sha, Text
"statuses"] []
statusForR :: Name Owner -> Name Repo -> Name Commit -> Request 'RW CombinedStatus
statusForR :: Name Owner
-> Name Repo -> Name Commit -> Request 'RW CombinedStatus
statusForR Name Owner
user Name Repo
repo Name Commit
sha =
Paths -> QueryString -> Request 'RW CombinedStatus
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"commits", Name Commit -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Commit
sha, Text
"status"] []