Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

add 'name' and 'description' to project hooks structs #2069

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,8 @@ type HookCustomHeader struct {
type ProjectHook struct {
ID int `json:"id"`
URL string `json:"url"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
cgahlon marked this conversation as resolved.
Show resolved Hide resolved
ConfidentialNoteEvents bool `json:"confidential_note_events"`
ProjectID int `json:"project_id"`
PushEvents bool `json:"push_events"`
Expand Down Expand Up @@ -1352,6 +1354,8 @@ func (s *ProjectsService) GetProjectHook(pid interface{}, hook int, options ...R
// GitLab API docs:
// https://docs.gitlab.com/ee/api/projects.html#add-project-hook
type AddProjectHookOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"`
ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
Expand Down Expand Up @@ -1403,6 +1407,8 @@ func (s *ProjectsService) AddProjectHook(pid interface{}, opt *AddProjectHookOpt
// GitLab API docs:
// https://docs.gitlab.com/ee/api/projects.html#edit-project-hook
type EditProjectHookOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"`
ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,8 @@ func TestListProjectHooks(t *testing.T) {
{
"id": 1,
"url": "http://example.com/hook",
"name": "This is the name of an example hook",
"description": "This is the description of an example hook",
"confidential_note_events": true,
"project_id": 1,
"push_events": true,
Expand Down Expand Up @@ -1541,6 +1543,8 @@ func TestListProjectHooks(t *testing.T) {
want := []*ProjectHook{{
ID: 1,
URL: "http://example.com/hook",
Name: "This is the name of an example hook",
Description: "This is the description of an example hook",
ConfidentialNoteEvents: true,
ProjectID: 1,
PushEvents: true,
Expand Down