Commit 9c000aa5 authored by Lorac's avatar Lorac Committed by Sander van Harmelen

Add user contribution events API (#319)

* Move events to event_type file

* Add user contribution events API
parent 8cb06a30
This diff is collapsed.
This diff is collapsed.
......@@ -180,6 +180,42 @@ const (
PublicVisibility VisibilityValue = "public"
)
// EventTypeValue represents actions type for contribution events
type EventTypeValue string
// List of available action type
//
// GitLab API docs: https://docs.gitlab.com/ce/api/events.html#action-types
const (
CreatedEventType EventTypeValue = "created"
UpdatedEventType EventTypeValue = "updated"
ClosedEventType EventTypeValue = "closed"
ReopenedEventType EventTypeValue = "reopened"
PushedEventType EventTypeValue = "pushed"
CommentedEventType EventTypeValue = "commented"
MergedEventType EventTypeValue = "merged"
JoinedEventType EventTypeValue = "joined"
LeftEventType EventTypeValue = "left"
DestroyedEventType EventTypeValue = "destroyed"
ExpiredEventType EventTypeValue = "expired"
)
// EventTargetTypeValue represents actions type value for contribution events
type EventTargetTypeValue string
// List of available action type
//
// GitLab API docs: https://docs.gitlab.com/ce/api/events.html#target-types
const (
IssueEventTargetType EventTargetTypeValue = "issue"
MilestoneEventTargetType EventTargetTypeValue = "milestone"
MergeRequestEventTargetType EventTargetTypeValue = "merge_request"
NoteEventTargetType EventTargetTypeValue = "note"
ProjectEventTargetType EventTargetTypeValue = "project"
SnippetEventTargetType EventTargetTypeValue = "snippet"
UserEventTargetType EventTargetTypeValue = "user"
)
// A Client manages communication with the GitLab API.
type Client struct {
// HTTP client used to communicate with the API.
......@@ -206,6 +242,7 @@ type Client struct {
Commits *CommitsService
DeployKeys *DeployKeysService
Environments *EnvironmentsService
Events *EventsService
Features *FeaturesService
Groups *GroupsService
GroupMembers *GroupMembersService
......@@ -285,6 +322,7 @@ func newClient(httpClient *http.Client, tokenType tokenType, token string) *Clie
c.Commits = &CommitsService{client: c}
c.DeployKeys = &DeployKeysService{client: c}
c.Environments = &EnvironmentsService{client: c}
c.Events = &EventsService{client: c}
c.Features = &FeaturesService{client: c}
c.Groups = &GroupsService{client: c}
c.GroupMembers = &GroupMembersService{client: c}
......
......@@ -47,10 +47,13 @@ type Note struct {
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
} `json:"author"`
System bool `json:"system"`
ExpiresAt *time.Time `json:"expires_at"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
System bool `json:"system"`
ExpiresAt *time.Time `json:"expires_at"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
NoteableID int `json:"noteable_id"`
NoteableType string `json:"noteable_type"`
NoteableIID int `json:"noteable_iid"`
}
func (n Note) String() string {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment