module GitHub.Endpoints.Issues.Milestones (
milestonesR,
milestoneR,
createMilestoneR,
updateMilestoneR,
deleteMilestoneR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
milestonesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Milestone)
milestonesR :: forall (k :: RW).
Name Owner
-> Name Repo -> FetchCount -> Request k (Vector Milestone)
milestonesR Name Owner
user Name Repo
repo =
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"milestones"] []
milestoneR :: Name Owner -> Name Repo -> Id Milestone -> Request k Milestone
milestoneR :: forall (k :: RW).
Name Owner -> Name Repo -> Id Milestone -> Request k Milestone
milestoneR Name Owner
user Name Repo
repo Id Milestone
mid =
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"milestones", forall a. IsPathPart a => a -> Text
toPathPart Id Milestone
mid] []
createMilestoneR :: Name Owner -> Name Repo -> NewMilestone -> Request 'RW Milestone
createMilestoneR :: Name Owner -> Name Repo -> NewMilestone -> Request 'RW Milestone
createMilestoneR Name Owner
user Name Repo
repo =
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"milestones"] forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ToJSON a => a -> ByteString
encode
updateMilestoneR :: Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> Request 'RW Milestone
updateMilestoneR :: Name Owner
-> Name Repo
-> Id Milestone
-> UpdateMilestone
-> Request 'RW Milestone
updateMilestoneR Name Owner
user Name Repo
repo Id Milestone
mid =
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Patch [Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"milestones", forall a. IsPathPart a => a -> Text
toPathPart Id Milestone
mid ] forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ToJSON a => a -> ByteString
encode
deleteMilestoneR :: Name Owner -> Name Repo -> Id Milestone -> GenRequest 'MtUnit 'RW ()
deleteMilestoneR :: Name Owner
-> Name Repo -> Id Milestone -> GenRequest 'MtUnit 'RW ()
deleteMilestoneR Name Owner
user Name Repo
repo Id Milestone
mid =
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Delete
[Text
"repos", forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"milestones", forall a. IsPathPart a => a -> Text
toPathPart Id Milestone
mid] forall a. Monoid a => a
mempty