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
81780eaa
Commit
81780eaa
authored
Jun 26, 2019
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak method names and run gofmt
parent
84bf518c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
53 deletions
+60
-53
resource_label_events.go
resource_label_events.go
+60
-53
No files found.
resource_label_events.go
View file @
81780eaa
...
...
@@ -21,8 +21,8 @@ import (
"time"
)
// ResourceLabelEventsService handles communication with the event related
methods of
// the GitLab API.
// ResourceLabelEventsService handles communication with the event related
//
methods of
the GitLab API.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html
type
ResourceLabelEventsService
struct
{
...
...
@@ -33,13 +33,13 @@ type ResourceLabelEventsService struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-issue-label-event
type
Resource
LabelEvent
struct
{
ID
int
`json:"id"`
Action
string
`json:"action"`
CreatedAt
*
time
.
Time
`json:"created_at"`
ResourceType
string
`json:"resource_type"`
ResourceID
int
`json:"resource_id"`
User
struct
{
type
LabelEvent
struct
{
ID
int
`json:"id"`
Action
string
`json:"action"`
CreatedAt
*
time
.
Time
`json:"created_at"`
ResourceType
string
`json:"resource_type"`
ResourceID
int
`json:"resource_id"`
User
struct
{
ID
int
`json:"id"`
Name
string
`json:"name"`
Username
string
`json:"username"`
...
...
@@ -56,21 +56,25 @@ type ResourceLabelEvent struct {
}
`json:"label"`
}
// ListResourceLabelEventsOptions represents the options for resource label events services list functions.
type
ListResourceLabelEventsOptions
struct
{
// ListLabelEventsOptions represents the options for all resource label events
// list methods.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-issue-label-events
type
ListLabelEventsOptions
struct
{
ListOptions
}
// ListIssue
ResourceLabelEvents retrieves resource label events
//
for the
specified project and issue.
// ListIssue
LabelEvents retrieves resource label events for the
// specified project and issue.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-issue-label-events
func
(
s
*
ResourceLabelEventsService
)
ListIssueResourceLabelEvents
(
pid
interface
{},
issue
int
,
opt
*
ListResourceLabelEventsOptions
,
options
...
OptionFunc
)
([]
*
ResourceLabelEvent
,
*
Response
,
error
)
{
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-issue-label-events
func
(
s
*
ResourceLabelEventsService
)
ListIssueLabelEvents
(
pid
interface
{},
issue
int
,
opt
*
ListLabelEventsOptions
,
options
...
OptionFunc
)
([]
*
LabelEvent
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/issues/%d/resource_label_events"
,
pathEscape
(
project
),
issue
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
...
...
@@ -78,19 +82,20 @@ func (s *ResourceLabelEventsService) ListIssueResourceLabelEvents(pid interface{
return
nil
,
nil
,
err
}
var
rs
[]
*
Resource
LabelEvent
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
r
s
)
var
ls
[]
*
LabelEvent
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
l
s
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
r
s
,
resp
,
err
return
l
s
,
resp
,
err
}
// GetIssue
Resource
LabelEvent gets a single issue-label-event.
// GetIssueLabelEvent gets a single issue-label-event.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-issue-label-event
func
(
s
*
ResourceLabelEventsService
)
GetIssueResourceLabelEvent
(
pid
interface
{},
issue
int
,
event
int
,
options
...
OptionFunc
)
(
*
ResourceLabelEvent
,
*
Response
,
error
)
{
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-issue-label-event
func
(
s
*
ResourceLabelEventsService
)
GetIssueLabelEvent
(
pid
interface
{},
issue
int
,
event
int
,
options
...
OptionFunc
)
(
*
LabelEvent
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -102,25 +107,25 @@ func (s *ResourceLabelEventsService) GetIssueResourceLabelEvent(pid interface{},
return
nil
,
nil
,
err
}
e
:=
new
(
Resource
LabelEvent
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
e
)
l
:=
new
(
LabelEvent
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
l
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
e
,
resp
,
err
return
l
,
resp
,
err
}
// ListGroupEpic
ResourceLabelEvents retrieves resource label events
//
for the specified
group and epic.
// ListGroupEpic
LabelEvents retrieves resource label events for the specified
// group and epic.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html#list-group-epic-label-events
func
(
s
*
ResourceLabelEventsService
)
ListGroupEpicResourceLabelEvents
(
gid
interface
{},
epic
int
,
opt
*
ListResourceLabelEventsOptions
,
options
...
OptionFunc
)
([]
*
ResourceLabelEvent
,
*
Response
,
error
)
{
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#list-group-epic-label-events
func
(
s
*
ResourceLabelEventsService
)
ListGroupEpicLabelEvents
(
gid
interface
{},
epic
int
,
opt
*
ListLabelEventsOptions
,
options
...
OptionFunc
)
([]
*
LabelEvent
,
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"groups/%s/epics/%d/resource_label_events"
,
pathEscape
(
group
),
epic
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
...
...
@@ -128,19 +133,20 @@ func (s *ResourceLabelEventsService) ListGroupEpicResourceLabelEvents(gid interf
return
nil
,
nil
,
err
}
var
rs
[]
*
Resource
LabelEvent
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
r
s
)
var
ls
[]
*
LabelEvent
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
l
s
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
r
s
,
resp
,
err
return
l
s
,
resp
,
err
}
// GetGroupEpic
Resource
LabelEvent gets a single group epic label event.
// GetGroupEpicLabelEvent gets a single group epic label event.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-epic-label-event
func
(
s
*
ResourceLabelEventsService
)
GetGroupEpicResourceLabelEvent
(
gid
interface
{},
epic
int
,
event
int
,
options
...
OptionFunc
)
(
*
ResourceLabelEvent
,
*
Response
,
error
)
{
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-epic-label-event
func
(
s
*
ResourceLabelEventsService
)
GetGroupEpicLabelEvent
(
gid
interface
{},
epic
int
,
event
int
,
options
...
OptionFunc
)
(
*
LabelEvent
,
*
Response
,
error
)
{
group
,
err
:=
parseID
(
gid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -152,25 +158,25 @@ func (s *ResourceLabelEventsService) GetGroupEpicResourceLabelEvent(gid interfac
return
nil
,
nil
,
err
}
e
:=
new
(
Resource
LabelEvent
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
e
)
l
:=
new
(
LabelEvent
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
l
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
e
,
resp
,
err
return
l
,
resp
,
err
}
// ListMerge
RequestResourceLabelEvents retrieves resource label events
//
for the specified
project and merge request.
// ListMerge
LabelEvents retrieves resource label events for the specified
// project and merge request.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-merge-request-label-events
func
(
s
*
ResourceLabelEventsService
)
ListMergeRequestResourceLabelEvents
(
pid
interface
{},
request
int
,
opt
*
ListResourceLabelEventsOptions
,
options
...
OptionFunc
)
([]
*
ResourceLabelEvent
,
*
Response
,
error
)
{
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#list-project-merge-request-label-events
func
(
s
*
ResourceLabelEventsService
)
ListMergeLabelEvents
(
pid
interface
{},
request
int
,
opt
*
ListLabelEventsOptions
,
options
...
OptionFunc
)
([]
*
LabelEvent
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/merge_requests/%d/resource_label_events"
,
pathEscape
(
project
),
request
)
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
...
...
@@ -178,19 +184,20 @@ func (s *ResourceLabelEventsService) ListMergeRequestResourceLabelEvents(pid int
return
nil
,
nil
,
err
}
var
rs
[]
*
Resource
LabelEvent
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
r
s
)
var
ls
[]
*
LabelEvent
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
l
s
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
r
s
,
resp
,
err
return
l
s
,
resp
,
err
}
// GetMergeRequest
Resource
LabelEvent gets a single merge request label event.
// GetMergeRequestLabelEvent gets a single merge request label event.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-merge-request-label-event
func
(
s
*
ResourceLabelEventsService
)
GetMergeRequestResourceLabelEvent
(
pid
interface
{},
request
int
,
event
int
,
options
...
OptionFunc
)
(
*
ResourceLabelEvent
,
*
Response
,
error
)
{
// GitLab API docs:
// https://docs.gitlab.com/ee/api/resource_label_events.html#get-single-merge-request-label-event
func
(
s
*
ResourceLabelEventsService
)
GetMergeRequestLabelEvent
(
pid
interface
{},
request
int
,
event
int
,
options
...
OptionFunc
)
(
*
LabelEvent
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -202,11 +209,11 @@ func (s *ResourceLabelEventsService) GetMergeRequestResourceLabelEvent(pid inter
return
nil
,
nil
,
err
}
e
:=
new
(
Resource
LabelEvent
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
e
)
l
:=
new
(
LabelEvent
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
l
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
e
,
resp
,
err
return
l
,
resp
,
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