module GitHub.Endpoints.Issues.Milestones (
milestones,
milestones',
milestonesR,
milestone,
milestoneR,
createMilestone,
createMilestoneR,
updateMilestone,
updateMilestoneR,
deleteMilestone,
deleteMilestoneR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
milestones :: Name Owner -> Name Repo -> IO (Either Error (Vector Milestone))
milestones = milestones' Nothing
milestones' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Milestone))
milestones' auth user repo =
executeRequestMaybe auth $ milestonesR user repo FetchAll
milestonesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Milestone)
milestonesR user repo =
pagedQuery ["repos", toPathPart user, toPathPart repo, "milestones"] []
milestone :: Name Owner -> Name Repo -> Id Milestone -> IO (Either Error Milestone)
milestone user repo mid =
executeRequest' $ milestoneR user repo mid
milestoneR :: Name Owner -> Name Repo -> Id Milestone -> Request k Milestone
milestoneR user repo mid =
query ["repos", toPathPart user, toPathPart repo, "milestones", toPathPart mid] []
createMilestone :: Auth -> Name Owner -> Name Repo -> NewMilestone -> IO (Either Error Milestone)
createMilestone auth user repo mlstn = executeRequest auth $ createMilestoneR user repo mlstn
createMilestoneR :: Name Owner -> Name Repo -> NewMilestone -> Request 'RW Milestone
createMilestoneR user repo =
command Post ["repos", toPathPart user, toPathPart repo, "milestones"] . encode
updateMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> IO (Either Error Milestone)
updateMilestone auth user repo mid mlstn = executeRequest auth $ updateMilestoneR user repo mid mlstn
updateMilestoneR :: Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> Request 'RW Milestone
updateMilestoneR user repo mid =
command Patch ["repos", toPathPart user, toPathPart repo, "milestones", toPathPart mid ] . encode
deleteMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> IO (Either Error ())
deleteMilestone auth user repo mid = executeRequest auth $ deleteMilestoneR user repo mid
deleteMilestoneR :: Name Owner -> Name Repo -> Id Milestone -> GenRequest 'MtUnit 'RW ()
deleteMilestoneR user repo mid =
Command Delete
["repos", toPathPart user, toPathPart repo, "milestones", toPathPart mid] mempty