Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9db8cf1

Browse files
pbrisbinphadej
authored andcommitted
Add deleteReference
1 parent ebc378a commit 9db8cf1

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
[#436](https://github.com/phadej/github/pull/436)
1111
- Teams improvements
1212
[#417](https://github.com/phadej/github/pull/417)
13-
13+
- Add deleteReference endpoint
14+
[#388](https://github.com/phadej/github/pull/388)
1415

1516
## Changes for 0.25
1617

src/GitHub.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ module GitHub (
100100
referenceR,
101101
referencesR,
102102
createReferenceR,
103+
deleteReferenceR,
104+
namespacedReferencesR,
103105

104106
-- ** Trees
105107
-- | See <https://developer.github.com/v3/git/trees/>

src/GitHub/Endpoints/GitData/References.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module GitHub.Endpoints.GitData.References (
1010
referenceR,
1111
referencesR,
1212
createReferenceR,
13+
deleteReferenceR,
1314
namespacedReferencesR,
1415
module GitHub.Data,
1516
) where
@@ -36,6 +37,12 @@ createReferenceR :: Name Owner -> Name Repo -> NewGitReference -> Request 'RW Gi
3637
createReferenceR user repo newRef =
3738
command Post ["repos", toPathPart user, toPathPart repo , "git", "refs"] (encode newRef)
3839

40+
-- | Delete a reference.
41+
-- See <https://developer.github.com/v3/git/refs/#delete-a-reference>
42+
deleteReferenceR :: Name Owner -> Name Repo -> Name GitReference -> GenRequest 'MtUnit 'RW ()
43+
deleteReferenceR user repo ref =
44+
Command Delete ["repos", toPathPart user, toPathPart repo , "git", "refs", toPathPart ref] mempty
45+
3946
-- | Query namespaced references.
4047
-- See <https://developer.github.com/v3/git/refs/#get-all-references>
4148
namespacedReferencesR :: Name Owner -> Name Repo -> Text -> Request k [GitReference]

0 commit comments

Comments
 (0)