Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
cf974dcb
Commit
cf974dcb
authored
Feb 10, 2018
by
Lorac
Committed by
Sander van Harmelen
Feb 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add paging option for award emoji API (#321)
parent
4676fc31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
award_emojis.go
award_emojis.go
+25
-16
No files found.
award_emojis.go
View file @
cf974dcb
...
...
@@ -56,31 +56,40 @@ const (
awardSnippets
=
"snippets"
)
// ListEmojiAwardsOptions represents the available options for listing emoji
// for each resources
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html
type
ListEmojiAwardsOptions
struct
{
ListOptions
}
// ListMergeRequestAwardEmoji gets a list of all award emoji on the merge request.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html#list-an-awardable-39-s-award-emoji
func
(
s
*
AwardEmojiService
)
ListMergeRequestAwardEmoji
(
pid
interface
{},
mergeRequestIID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmoji
(
pid
,
awardMergeRequest
,
mergeRequestIID
,
options
...
)
func
(
s
*
AwardEmojiService
)
ListMergeRequestAwardEmoji
(
pid
interface
{},
mergeRequestIID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmoji
(
pid
,
awardMergeRequest
,
mergeRequestIID
,
opt
,
opt
ions
...
)
}
// ListIssueAwardEmoji gets a list of all award emoji on the issue.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html#list-an-awardable-39-s-award-emoji
func
(
s
*
AwardEmojiService
)
ListIssueAwardEmoji
(
pid
interface
{},
issueIID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmoji
(
pid
,
awardIssue
,
issueIID
,
options
...
)
func
(
s
*
AwardEmojiService
)
ListIssueAwardEmoji
(
pid
interface
{},
issueIID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmoji
(
pid
,
awardIssue
,
issueIID
,
opt
,
opt
ions
...
)
}
// ListSnippetAwardEmoji gets a list of all award emoji on the snippet.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html#list-an-awardable-39-s-award-emoji
func
(
s
*
AwardEmojiService
)
ListSnippetAwardEmoji
(
pid
interface
{},
snippetID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmoji
(
pid
,
awardSnippets
,
snippetID
,
options
...
)
func
(
s
*
AwardEmojiService
)
ListSnippetAwardEmoji
(
pid
interface
{},
snippetID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmoji
(
pid
,
awardSnippets
,
snippetID
,
opt
,
opt
ions
...
)
}
func
(
s
*
AwardEmojiService
)
listAwardEmoji
(
pid
interface
{},
resource
string
,
resourceID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
func
(
s
*
AwardEmojiService
)
listAwardEmoji
(
pid
interface
{},
resource
string
,
resourceID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -91,7 +100,7 @@ func (s *AwardEmojiService) listAwardEmoji(pid interface{}, resource string, res
resourceID
,
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
...
...
@@ -253,8 +262,8 @@ func (s *AwardEmojiService) deleteAwardEmoji(pid interface{}, resource string, r
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html#award-emoji-on-notes
func
(
s
*
AwardEmojiService
)
ListIssuesAwardEmojiOnNote
(
pid
interface
{},
issueID
,
noteID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmojiOnNote
(
pid
,
awardIssue
,
issueID
,
noteID
,
options
...
)
func
(
s
*
AwardEmojiService
)
ListIssuesAwardEmojiOnNote
(
pid
interface
{},
issueID
,
noteID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmojiOnNote
(
pid
,
awardIssue
,
issueID
,
noteID
,
opt
,
opt
ions
...
)
}
// ListMergeRequestAwardEmojiOnNote gets a list of all award emoji on a note
...
...
@@ -262,8 +271,8 @@ func (s *AwardEmojiService) ListIssuesAwardEmojiOnNote(pid interface{}, issueID,
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html#award-emoji-on-notes
func
(
s
*
AwardEmojiService
)
ListMergeRequestAwardEmojiOnNote
(
pid
interface
{},
mergeRequestIID
,
noteID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmojiOnNote
(
pid
,
awardMergeRequest
,
mergeRequestIID
,
noteID
,
options
...
)
func
(
s
*
AwardEmojiService
)
ListMergeRequestAwardEmojiOnNote
(
pid
interface
{},
mergeRequestIID
,
noteID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmojiOnNote
(
pid
,
awardMergeRequest
,
mergeRequestIID
,
noteID
,
opt
,
opt
ions
...
)
}
// ListSnippetAwardEmojiOnNote gets a list of all award emoji on a note from the
...
...
@@ -271,11 +280,11 @@ func (s *AwardEmojiService) ListMergeRequestAwardEmojiOnNote(pid interface{}, me
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/award_emoji.html#award-emoji-on-notes
func
(
s
*
AwardEmojiService
)
ListSnippetAwardEmojiOnNote
(
pid
interface
{},
snippetIID
,
noteID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmojiOnNote
(
pid
,
awardSnippets
,
snippetIID
,
noteID
,
options
...
)
func
(
s
*
AwardEmojiService
)
ListSnippetAwardEmojiOnNote
(
pid
interface
{},
snippetIID
,
noteID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
return
s
.
listAwardEmojiOnNote
(
pid
,
awardSnippets
,
snippetIID
,
noteID
,
opt
,
opt
ions
...
)
}
func
(
s
*
AwardEmojiService
)
listAwardEmojiOnNote
(
pid
interface
{},
resources
string
,
ressourceID
,
noteID
int
,
options
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
func
(
s
*
AwardEmojiService
)
listAwardEmojiOnNote
(
pid
interface
{},
resources
string
,
ressourceID
,
noteID
int
,
opt
*
ListEmojiAwardsOptions
,
opt
ions
...
OptionFunc
)
([]
*
AwardEmoji
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -283,7 +292,7 @@ func (s *AwardEmojiService) listAwardEmojiOnNote(pid interface{}, resources stri
u
:=
fmt
.
Sprintf
(
"projects/%s/%s/%d/notes/%d/award_emoji"
,
url
.
QueryEscape
(
project
),
resources
,
ressourceID
,
noteID
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment