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 =
Paths -> QueryString -> FetchCount -> Request k (Vector Milestone)
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
"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 =
Paths -> QueryString -> Request k Milestone
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
"milestones", Id Milestone -> Text
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 =
CommandMethod -> Paths -> ByteString -> Request 'RW Milestone
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post [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
"milestones"] (ByteString -> Request 'RW Milestone)
-> (NewMilestone -> ByteString)
-> NewMilestone
-> Request 'RW Milestone
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NewMilestone -> ByteString
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 =
CommandMethod -> Paths -> ByteString -> Request 'RW Milestone
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Patch [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
"milestones", Id Milestone -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id Milestone
mid ] (ByteString -> Request 'RW Milestone)
-> (UpdateMilestone -> ByteString)
-> UpdateMilestone
-> Request 'RW Milestone
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UpdateMilestone -> ByteString
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 =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Delete
[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
"milestones", Id Milestone -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id Milestone
mid] ByteString
forall a. Monoid a => a
mempty