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

Commit

Permalink
Merge pull request #2069 from cgahlon/cgahlon/add-name-and-descriptio…
Browse files Browse the repository at this point in the history
…n-to-project-hooks

add 'name' and 'description' to project hooks structs
  • Loading branch information
RicePatrick authored Nov 29, 2024
2 parents 9851eab + f19511b commit 35c2003
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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"`
Description string `json:"description"`
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

0 comments on commit 35c2003

Please sign in to comment.