Repository: xanzy/go-gitlab
Pull request #1427 (2022-03-23 01:42:48)

Align group hooks with GitLab API
`push_events_branch_filter` is not yet documented, but it is there. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82531

`subgroup_events` has been around since 2021 https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52658


Patch:
diff --git a/event_webhook_types.go b/event_webhook_types.go
index 237fcb8..aff4c4d 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -870,20 +870,20 @@ type SnippetCommentEvent struct {
 		URL          string `json:"url"`
 	} `json:"object_attributes"`
 	Snippet *struct {
-		ID                 int        `json:"id"`
-		Title              string     `json:"title"`
-		Content            string     `json:"content"`
-		AuthorID           int        `json:"author_id"`
-		ProjectID          int        `json:"project_id"`
-		CreatedAt          string     `json:"created_at"`
-		UpdatedAt          string     `json:"updated_at"`
-		Filename           string     `json:"file_name"`
-		ExpiresAt          string     `json:"expires_at"`
-		Type               string     `json:"type"`
-		VisibilityLevel    int        `json:"visibility_level"`
-		Description        string     `json:"description"`
-		Secret             bool       `json:"secret"`
-		RepositoryReadOnly bool       `json:"repository_read_only"`
+		ID                 int    `json:"id"`
+		Title              string `json:"title"`
+		Content            string `json:"content"`
+		AuthorID           int    `json:"author_id"`
+		ProjectID          int    `json:"project_id"`
+		CreatedAt          string `json:"created_at"`
+		UpdatedAt          string `json:"updated_at"`
+		Filename           string `json:"file_name"`
+		ExpiresAt          string `json:"expires_at"`
+		Type               string `json:"type"`
+		VisibilityLevel    int    `json:"visibility_level"`
+		Description        string `json:"description"`
+		Secret             bool   `json:"secret"`
+		RepositoryReadOnly bool   `json:"repository_read_only"`
 	} `json:"snippet"`
 }
 
diff --git a/group_hooks.go b/group_hooks.go
index 55c44f1..acb51d9 100644
--- a/group_hooks.go
+++ b/group_hooks.go
@@ -30,6 +30,7 @@ type GroupHook struct {
 	URL                      string     `json:"url"`
 	GroupID                  int        `json:"group_id"`
 	PushEvents               bool       `json:"push_events"`
+	PushEventsBranchFilter   string     `json:"push_events_branch_filter"`
 	IssuesEvents             bool       `json:"issues_events"`
 	ConfidentialIssuesEvents bool       `json:"confidential_issues_events"`
 	ConfidentialNoteEvents   bool       `json:"confidential_note_events"`
@@ -41,6 +42,7 @@ type GroupHook struct {
 	WikiPageEvents           bool       `json:"wiki_page_events"`
 	DeploymentEvents         bool       `json:"deployment_events"`
 	ReleasesEvents           bool       `json:"releases_events"`
+	SubGroupEvents           bool       `json:"subgroup_events"`
 	EnableSSLVerification    bool       `json:"enable_ssl_verification"`
 	CreatedAt                *time.Time `json:"created_at"`
 }
@@ -99,6 +101,7 @@ func (s *GroupsService) GetGroupHook(pid interface{}, hook int, options ...Reque
 type AddGroupHookOptions struct {
 	URL                      *string `url:"url,omitempty" json:"url,omitempty"`
 	PushEvents               *bool   `url:"push_events,omitempty"  json:"push_events,omitempty"`
+	PushEventsBranchFilter   *string `url:"push_events_branch_filter,omitempty"  json:"push_events_branch_filter,omitempty"`
 	IssuesEvents             *bool   `url:"issues_events,omitempty"  json:"issues_events,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"`
@@ -110,6 +113,7 @@ type AddGroupHookOptions struct {
 	WikiPageEvents           *bool   `url:"wiki_page_events,omitempty"  json:"wiki_page_events,omitempty"`
 	DeploymentEvents         *bool   `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
 	ReleasesEvents           *bool   `url:"releases_events,omitempty" json:"releases_events,omitempty"`
+	SubGroupEvents           *bool   `url:"subgroup_events,omitempty" json:"subgroup_events,omitempty"`
 	EnableSSLVerification    *bool   `url:"enable_ssl_verification,omitempty"  json:"enable_ssl_verification,omitempty"`
 	Token                    *string `url:"token,omitempty" json:"token,omitempty"`
 }
@@ -145,6 +149,7 @@ func (s *GroupsService) AddGroupHook(gid interface{}, opt *AddGroupHookOptions,
 type EditGroupHookOptions struct {
 	URL                      *string `url:"url,omitempty" json:"url,omitempty"`
 	PushEvents               *bool   `url:"push_events,omitempty" json:"push_events,omitempty"`
+	PushEventsBranchFilter   *string `url:"push_events_branch_filter,omitempty"  json:"push_events_branch_filter,omitempty"`
 	IssuesEvents             *bool   `url:"issues_events,omitempty" json:"issues_events,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"`
@@ -156,6 +161,7 @@ type EditGroupHookOptions struct {
 	WikiPageEvents           *bool   `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
 	DeploymentEvents         *bool   `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
 	ReleasesEvents           *bool   `url:"releases_events,omitempty" json:"releases_events,omitempty"`
+	SubGroupEvents           *bool   `url:"subgroup_events,omitempty" json:"subgroup_events,omitempty"`
 	EnableSSLVerification    *bool   `url:"enable_ssl_verification,omitempty" json:"enable_ssl_verification,omitempty"`
 	Token                    *string `url:"token,omitempty" json:"token,omitempty"`
 }
diff --git a/group_wikis.go b/group_wikis.go
index ecf9c27..55e51da 100644
--- a/group_wikis.go
+++ b/group_wikis.go
@@ -33,11 +33,10 @@ type GroupWikisService struct {
 //
 // GitLab API docs: https://docs.gitlab.com/ee/api/group_wikis.html
 type GroupWiki struct {
-	Content  string          `json:"content"`
-	Encoding string          `json:"encoding"`
-	Format   WikiFormatValue `json:"format"`
-	Slug     string          `json:"slug"`
-	Title    string          `json:"title"`
+	Content string          `json:"content"`
+	Format  WikiFormatValue `json:"format"`
+	Slug    string          `json:"slug"`
+	Title   string          `json:"title"`
 }
 
 func (w GroupWiki) String() string {
@@ -78,27 +77,18 @@ func (s *GroupWikisService) ListGroupWikis(gid interface{}, opt *ListGroupWikisO
 	return gws, resp, err
 }
 
-// GetGroupWikiPageOptions represents options to GetGroupWikiPage
-//
-// GitLab API docs:
-// https://docs.gitlab.com/ee/api/group_wikis.html#get-a-wiki-page
-type GetGroupWikiPageOptions struct {
-	RenderHTML *bool   `url:"render_html,omitempty" json:"render_html,omitempty"`
-	Version    *string `url:"version,omitempty" json:"version,omitempty"`
-}
-
 // GetGroupWikiPage gets a wiki page for a given group.
 //
 // GitLab API docs:
 // https://docs.gitlab.com/ee/api/group_wikis.html#get-a-wiki-page
-func (s *GroupWikisService) GetGroupWikiPage(gid interface{}, slug string, opt *GetGroupWikiPageOptions, options ...RequestOptionFunc) (*GroupWiki, *Response, error) {
+func (s *GroupWikisService) GetGroupWikiPage(gid interface{}, slug string, options ...RequestOptionFunc) (*GroupWiki, *Response, error) {
 	group, err := parseID(gid)
 	if err != nil {
 		return nil, nil, err
 	}
 	u := fmt.Sprintf("groups/%s/wikis/%s", PathEscape(group), url.PathEscape(slug))
 
-	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
+	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
 	if err != nil {
 		return nil, nil, err
 	}
@@ -126,7 +116,7 @@ type CreateGroupWikiPageOptions struct {
 // the given title, slug, and content.
 //
 // GitLab API docs:
-// https://docs.gitlab.com/ee/api/group_wikis.html#create-a-new-wiki-page
+// https://docs.gitlab.com/13.8/ee/api/group_wikis.html#create-a-new-wiki-page
 func (s *GroupWikisService) CreateGroupWikiPage(gid interface{}, opt *CreateGroupWikiPageOptions, options ...RequestOptionFunc) (*GroupWiki, *Response, error) {
 	group, err := parseID(gid)
 	if err != nil {
diff --git a/groups.go b/groups.go
index 28174cb..3f03e9e 100644
--- a/groups.go
+++ b/groups.go
@@ -125,17 +125,17 @@ func (s *GroupsService) ListGroups(opt *ListGroupsOptions, options ...RequestOpt
 	return gs, resp, err
 }
 
-// ListSubgroupsOptions represents the available ListSubgroups() options.
+// ListSubGroupsOptions represents the available ListSubGroups() options.
 //
 // GitLab API docs:
 // https://docs.gitlab.com/ce/api/groups.html#list-a-groups-s-subgroups
-type ListSubgroupsOptions ListGroupsOptions
+type ListSubGroupsOptions ListGroupsOptions
 
-// ListSubgroups gets a list of subgroups for a given group.
+// ListSubGroups gets a list of subgroups for a given group.
 //
 // GitLab API docs:
 // https://docs.gitlab.com/ce/api/groups.html#list-a-groups-s-subgroups
-func (s *GroupsService) ListSubgroups(gid interface{}, opt *ListSubgroupsOptions, options ...RequestOptionFunc) ([]*Group, *Response, error) {
+func (s *GroupsService) ListSubGroups(gid interface{}, opt *ListSubGroupsOptions, options ...RequestOptionFunc) ([]*Group, *Response, error) {
 	group, err := parseID(gid)
 	if err != nil {
 		return nil, nil, err
@@ -195,7 +195,7 @@ func (s *GroupsService) ListDescendantGroups(gid interface{}, opt *ListDescendan
 type ListGroupProjectsOptions struct {
 	ListOptions
 	Archived                 *bool             `url:"archived,omitempty" json:"archived,omitempty"`
-	IncludeSubgroups         *bool             `url:"include_subgroups,omitempty" json:"include_subgroups,omitempty"`
+	IncludeSubGroups         *bool             `url:"include_subgroups,omitempty" json:"include_subgroups,omitempty"`
 	MinAccessLevel           *AccessLevelValue `url:"min_access_level,omitempty" json:"min_access_level,omitempty"`
 	OrderBy                  *string           `url:"order_by,omitempty" json:"order_by,omitempty"`
 	Owned                    *bool             `url:"owned,omitempty" json:"owned,omitempty"`
diff --git a/packages.go b/packages.go
index 37fe0e0..06a1937 100644
--- a/packages.go
+++ b/packages.go
@@ -136,7 +136,7 @@ func (s *PackagesService) ListProjectPackages(pid interface{}, opt *ListProjectP
 // https://docs.gitlab.com/ee/api/packages.html#within-a-group
 type ListGroupPackagesOptions struct {
 	ListOptions
-	ExcludeSubgroups   *bool   `url:"exclude_subgroups,omitempty" json:"exclude_subgroups,omitempty"`
+	ExcludeSubGroups   *bool   `url:"exclude_subgroups,omitempty" json:"exclude_subgroups,omitempty"`
 	OrderBy            *string `url:"order_by,omitempty" json:"order_by,omitempty"`
 	Sort               *string `url:"sort,omitempty" json:"sort,omitempty"`
 	PackageType        *string `url:"package_type,omitempty" json:"package_type,omitempty"`
diff --git a/settings.go b/settings.go
index 9cc8e4b..23039f5 100644
--- a/settings.go
+++ b/settings.go
@@ -104,9 +104,6 @@ type Settings struct {
 	GrafanaEnabled                            bool              `json:"grafana_enabled"`
 	GrafanaURL                                string            `json:"grafana_url"`
 	GravatarEnabled                           bool              `json:"gravatar_enabled"`
-	GroupDownloadExportLimit                  int               `json:"group_download_export_limit"`
-	GroupExportLimit                          int               `json:"group_export_limit"`
-	GroupImportLimit                          int               `json:"group_import_limit"`
 	HashedStorageEnabled                      bool              `json:"hashed_storage_enabled"`
 	HelpPageHideCommercialContent             bool              `json:"help_page_hide_commercial_content"`
 	HelpPageSupportURL                        string            `json:"help_page_support_url"`
@@ -149,9 +146,6 @@ type Settings struct {
 	PlantumlURL                               string            `json:"plantuml_url"`
 	PollingIntervalMultiplier                 float64           `json:"polling_interval_multiplier,string"`
 	ProjectExportEnabled                      bool              `json:"project_export_enabled"`
-	ProjectDownloadExportLimit                int               `json:"project_download_export_limit"`
-	ProjectExportLimit                        int               `json:"project_export_limit"`
-	ProjectImportLimit                        int               `json:"project_import_limit"`
 	PrometheusMetricsEnabled                  bool              `json:"prometheus_metrics_enabled"`
 	ProtectedCIVariables                      bool              `json:"protected_ci_variables"`
 	PseudonymizerEnabled                      bool              `json:"psedonymizer_enabled"`
@@ -303,9 +297,6 @@ type UpdateSettingsOptions struct {
 	GrafanaEnabled                            *bool              `url:"grafana_enabled,omitempty" json:"grafana_enabled,omitempty"`
 	GrafanaURL                                *string            `url:"grafana_url,omitempty" json:"grafana_url,omitempty"`
 	GravatarEnabled                           *bool              `url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"`
-	GroupDownloadExportLimit                  *int               `url:"group_download_export_limit,omitempty" json:"group_download_export_limit,omitempty"`
-	GroupExportLimit                          *int               `url:"group_export_limit,omitempty" json:"group_export_limit,omitempty"`
-	GroupImportLimit                          *int               `url:"group_import_limit,omitempty" json:"group_import_limit,omitempty"`
 	HashedStorageEnabled                      *bool              `url:"hashed_storage_enabled,omitempty" json:"hashed_storage_enabled,omitempty"`
 	HelpPageHideCommercialContent             *bool              `url:"help_page_hide_commercial_content,omitempty" json:"help_page_hide_commercial_content,omitempty"`
 	HelpPageSupportURL                        *string            `url:"help_page_support_url,omitempty" json:"help_page_support_url,omitempty"`
@@ -348,9 +339,6 @@ type UpdateSettingsOptions struct {
 	PlantumlURL                               *string            `url:"plantuml_url,omitempty" json:"plantuml_url,omitempty"`
 	PollingIntervalMultiplier                 *float64           `url:"polling_interval_multiplier,omitempty" json:"polling_interval_multiplier,omitempty"`
 	ProjectExportEnabled                      *bool              `url:"project_export_enabled,omitempty" json:"project_export_enabled,omitempty"`
-	ProjectDownloadExportLimit                *int               `url:"project_download_export_limit,omitempty" json:"project_download_export_limit,omitempty"`
-	ProjectExportLimit                        *int               `url:"project_export_limit,omitempty" json:"project_export_limit,omitempty"`
-	ProjectImportLimit                        *int               `url:"project_import_limit,omitempty" json:"project_import_limit,omitempty"`
 	PrometheusMetricsEnabled                  *bool              `url:"prometheus_metrics_enabled,omitempty" json:"prometheus_metrics_enabled,omitempty"`
 	ProtectedCIVariables                      *bool              `url:"protected_ci_variables,omitempty" json:"protected_ci_variables,omitempty"`
 	PseudonymizerEnabled                      *bool              `url:"psedonymizer_enabled,omitempty" json:"psedonymizer_enabled,omitempty"`
diff --git a/wikis.go b/wikis.go
index d946c04..1139956 100644
--- a/wikis.go
+++ b/wikis.go
@@ -33,11 +33,10 @@ type WikisService struct {
 //
 // GitLab API docs: https://docs.gitlab.com/ce/api/wikis.html
 type Wiki struct {
-	Content  string          `json:"content"`
-	Encoding string          `json:"encoding"`
-	Format   WikiFormatValue `json:"format"`
-	Slug     string          `json:"slug"`
-	Title    string          `json:"title"`
+	Content string          `json:"content"`
+	Format  WikiFormatValue `json:"format"`
+	Slug    string          `json:"slug"`
+	Title   string          `json:"title"`
 }
 
 func (w Wiki) String() string {
@@ -78,27 +77,18 @@ func (s *WikisService) ListWikis(pid interface{}, opt *ListWikisOptions, options
 	return ws, resp, err
 }
 
-// GetWikiPageOptions represents options to GetWikiPage
-//
-// GitLab API docs:
-// https://docs.gitlab.com/ee/api/wikis.html#get-a-wiki-page
-type GetWikiPageOptions struct {
-	RenderHTML *bool   `url:"render_html,omitempty" json:"render_html,omitempty"`
-	Version    *string `url:"version,omitempty" json:"version,omitempty"`
-}
-
 // GetWikiPage gets a wiki page for a given project.
 //
 // GitLab API docs:
 // https://docs.gitlab.com/ce/api/wikis.html#get-a-wiki-page
-func (s *WikisService) GetWikiPage(pid interface{}, slug string, opt *GetWikiPageOptions, options ...RequestOptionFunc) (*Wiki, *Response, error) {
+func (s *WikisService) GetWikiPage(pid interface{}, slug string, options ...RequestOptionFunc) (*Wiki, *Response, error) {
 	project, err := parseID(pid)
 	if err != nil {
 		return nil, nil, err
 	}
 	u := fmt.Sprintf("projects/%s/wikis/%s", PathEscape(project), url.PathEscape(slug))
 
-	req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
+	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
 	if err != nil {
 		return nil, nil, err
 	}


Test patch:
diff --git a/event_webhook_types_test.go b/event_webhook_types_test.go
index b0119da..175f05b 100644
--- a/event_webhook_types_test.go
+++ b/event_webhook_types_test.go
@@ -441,8 +441,8 @@ func TestSubGroupEventUnmarshal(t *testing.T) {
 		t.Errorf("SubGroup Event is null")
 	}
 
-	if event.Name != "Subgroup 1" {
-		t.Errorf("Name is %v, want %v", event.Name, "Subgroup 1")
+	if event.Name != "SubGroup 1" {
+		t.Errorf("Name is %v, want %v", event.Name, "SubGroup 1")
 	}
 
 	if event.GroupID != 2 {
diff --git a/group_hooks_test.go b/group_hooks_test.go
index 7f0961f..07775c8 100644
--- a/group_hooks_test.go
+++ b/group_hooks_test.go
@@ -37,6 +37,7 @@ func TestListGroupHooks(t *testing.T) {
 		"url": "http://example.com/hook",
 		"group_id": 3,
 		"push_events": true,
+		"push_events_branch_filter": "main",
 		"issues_events": true,
 		"confidential_issues_events": true,
 		"merge_requests_events": true,
@@ -47,6 +48,7 @@ func TestListGroupHooks(t *testing.T) {
 		"wiki_page_events": true,
 		"deployment_events": true,
 		"releases_events": true,
+		"subgroup_events": true,
 		"enable_ssl_verification": true,
 		"created_at": "2012-10-12T17:04:47Z"
 	}
@@ -64,6 +66,7 @@ func TestListGroupHooks(t *testing.T) {
 		URL:                      "http://example.com/hook",
 		GroupID:                  3,
 		PushEvents:               true,
+		PushEventsBranchFilter:   "main",
 		IssuesEvents:             true,
 		ConfidentialIssuesEvents: true,
 		MergeRequestsEvents:      true,
@@ -74,6 +77,7 @@ func TestListGroupHooks(t *testing.T) {
 		WikiPageEvents:           true,
 		DeploymentEvents:         true,
 		ReleasesEvents:           true,
+		SubGroupEvents:           true,
 		EnableSSLVerification:    true,
 		CreatedAt:                &datePointer,
 	}}
@@ -95,6 +99,7 @@ func TestGetGroupHook(t *testing.T) {
 	"url": "http://example.com/hook",
 	"group_id": 3,
 	"push_events": true,
+	"push_events_branch_filter": "main",
 	"issues_events": true,
 	"confidential_issues_events": true,
 	"merge_requests_events": true,
@@ -105,6 +110,7 @@ func TestGetGroupHook(t *testing.T) {
 	"wiki_page_events": true,
 	"deployment_events": true,
 	"releases_events": true,
+	"subgroup_events": true,
 	"enable_ssl_verification": true,
 	"created_at": "2012-10-12T17:04:47Z"
 }`)
@@ -121,6 +127,7 @@ func TestGetGroupHook(t *testing.T) {
 		URL:                      "http://example.com/hook",
 		GroupID:                  3,
 		PushEvents:               true,
+		PushEventsBranchFilter:   "main",
 		IssuesEvents:             true,
 		ConfidentialIssuesEvents: true,
 		MergeRequestsEvents:      true,
@@ -131,6 +138,7 @@ func TestGetGroupHook(t *testing.T) {
 		WikiPageEvents:           true,
 		DeploymentEvents:         true,
 		ReleasesEvents:           true,
+		SubGroupEvents:           true,
 		EnableSSLVerification:    true,
 		CreatedAt:                &datePointer,
 	}
@@ -152,6 +160,7 @@ func TestAddGroupHook(t *testing.T) {
 	"url": "http://example.com/hook",
 	"group_id": 3,
 	"push_events": true,
+	"push_events_branch_filter": "main",
 	"issues_events": true,
 	"confidential_issues_events": true,
 	"merge_requests_events": true,
@@ -162,6 +171,7 @@ func TestAddGroupHook(t *testing.T) {
 	"wiki_page_events": true,
 	"deployment_events": true,
 	"releases_events": true,
+	"subgroup_events": true,
 	"enable_ssl_verification": true,
 	"created_at": "2012-10-12T17:04:47Z"
 }`)
@@ -183,6 +193,7 @@ func TestAddGroupHook(t *testing.T) {
 		URL:                      "http://example.com/hook",
 		GroupID:                  3,
 		PushEvents:               true,
+		PushEventsBranchFilter:   "main",
 		IssuesEvents:             true,
 		ConfidentialIssuesEvents: true,
 		ConfidentialNoteEvents:   false,
@@ -194,6 +205,7 @@ func TestAddGroupHook(t *testing.T) {
 		WikiPageEvents:           true,
 		DeploymentEvents:         true,
 		ReleasesEvents:           true,
+		SubGroupEvents:           true,
 		EnableSSLVerification:    true,
 		CreatedAt:                &datePointer,
 	}
@@ -215,6 +227,7 @@ func TestEditGroupHook(t *testing.T) {
 	"url": "http://example.com/hook",
 	"group_id": 3,
 	"push_events": true,
+	"push_events_branch_filter": "main",
 	"issues_events": true,
 	"confidential_issues_events": true,
 	"merge_requests_events": true,
@@ -225,6 +238,7 @@ func TestEditGroupHook(t *testing.T) {
 	"wiki_page_events": true,
 	"deployment_events": true,
 	"releases_events": true,
+	"subgroup_events": true,
 	"enable_ssl_verification": true,
 	"created_at": "2012-10-12T17:04:47Z"
 }`)
@@ -246,6 +260,7 @@ func TestEditGroupHook(t *testing.T) {
 		URL:                      "http://example.com/hook",
 		GroupID:                  3,
 		PushEvents:               true,
+		PushEventsBranchFilter:   "main",
 		IssuesEvents:             true,
 		ConfidentialIssuesEvents: true,
 		ConfidentialNoteEvents:   false,
@@ -257,6 +272,7 @@ func TestEditGroupHook(t *testing.T) {
 		WikiPageEvents:           true,
 		DeploymentEvents:         true,
 		ReleasesEvents:           true,
+		SubGroupEvents:           true,
 		EnableSSLVerification:    true,
 		CreatedAt:                &datePointer,
 	}
diff --git a/group_wikis_test.go b/group_wikis_test.go
index 826ef15..4d2735e 100644
--- a/group_wikis_test.go
+++ b/group_wikis_test.go
@@ -14,14 +14,7 @@ func TestListGroupWikis(t *testing.T) {
 	mux.HandleFunc("/api/v4/groups/1/wikis",
 		func(w http.ResponseWriter, r *http.Request) {
 			testMethod(t, r, http.MethodGet)
-			fmt.Fprint(w, `[
-				{
-					"content": "content here",
-					"format": "markdown",
-					"slug": "deploy",
-					"title": "deploy title"
-				}
-			]`)
+			fmt.Fprint(w, `[{"content":"content here","format":"markdown","slug":"deploy","title":"deploy title"}]`)
 		})
 
 	groupwikis, _, err := client.GroupWikis.ListGroupWikis(1, &ListGroupWikisOptions{})
@@ -29,14 +22,7 @@ func TestListGroupWikis(t *testing.T) {
 		t.Errorf("GroupWikis.ListGroupWikis returned error: %v", err)
 	}
 
-	want := []*GroupWiki{
-		{
-			Content: "content here",
-			Format:  WikiFormatMarkdown,
-			Slug:    "deploy",
-			Title:   "deploy title",
-		},
-	}
+	want := []*GroupWiki{{Content: "content here", Format: WikiFormatMarkdown, Slug: "deploy", Title: "deploy title"}}
 	if !reflect.DeepEqual(want, groupwikis) {
 		t.Errorf("GroupWikis.ListGroupWikis returned %+v, want %+v", groupwikis, want)
 	}
@@ -49,27 +35,15 @@ func TestGetGroupWikiPage(t *testing.T) {
 	mux.HandleFunc("/api/v4/groups/1/wikis/deploy",
 		func(w http.ResponseWriter, r *http.Request) {
 			testMethod(t, r, http.MethodGet)
-			fmt.Fprint(w, `{
-				"content": "content here",
-				"format": "asciidoc",
-				"slug": "deploy",
-				"title": "deploy title",
-				"encoding": "UTF-8"
-			}`)
+			fmt.Fprint(w, `{"content":"content here","format":"asciidoc","slug":"deploy","title":"deploy title"}`)
 		})
 
-	groupwiki, _, err := client.GroupWikis.GetGroupWikiPage(1, "deploy", &GetGroupWikiPageOptions{})
+	groupwiki, _, err := client.GroupWikis.GetGroupWikiPage(1, "deploy")
 	if err != nil {
 		t.Errorf("GroupWikis.GetGroupWikiPage returned error: %v", err)
 	}
 
-	want := &GroupWiki{
-		Content:  "content here",
-		Encoding: "UTF-8",
-		Format:   WikiFormatASCIIDoc,
-		Slug:     "deploy",
-		Title:    "deploy title",
-	}
+	want := &GroupWiki{Content: "content here", Format: WikiFormatASCIIDoc, Slug: "deploy", Title: "deploy title"}
 	if !reflect.DeepEqual(want, groupwiki) {
 		t.Errorf("GroupWikis.GetGroupWikiPage returned %+v, want %+v", groupwiki, want)
 	}
@@ -82,12 +56,7 @@ func TestCreateGroupWikiPage(t *testing.T) {
 	mux.HandleFunc("/api/v4/groups/1/wikis",
 		func(w http.ResponseWriter, r *http.Request) {
 			testMethod(t, r, http.MethodPost)
-			fmt.Fprint(w, `{
-				"content": "content here",
-				"format": "rdoc",
-				"slug": "deploy",
-				"title": "deploy title"
-			}`)
+			fmt.Fprint(w, `{"content":"content here","format":"rdoc","slug":"deploy","title":"deploy title"}`)
 		})
 
 	groupwiki, _, err := client.GroupWikis.CreateGroupWikiPage(1, &CreateGroupWikiPageOptions{
@@ -99,12 +68,7 @@ func TestCreateGroupWikiPage(t *testing.T) {
 		t.Errorf("GroupWikis.CreateGroupWikiPage returned error: %v", err)
 	}
 
-	want := &GroupWiki{
-		Content: "content here",
-		Format:  WikiFormatRDoc,
-		Slug:    "deploy",
-		Title:   "deploy title",
-	}
+	want := &GroupWiki{Content: "content here", Format: WikiFormatRDoc, Slug: "deploy", Title: "deploy title"}
 	if !reflect.DeepEqual(want, groupwiki) {
 		t.Errorf("GroupWikis.CreateGroupWikiPage returned %+v, want %+v", groupwiki, want)
 	}
@@ -117,12 +81,7 @@ func TestEditGroupWikiPage(t *testing.T) {
 	mux.HandleFunc("/api/v4/groups/1/wikis/deploy",
 		func(w http.ResponseWriter, r *http.Request) {
 			testMethod(t, r, http.MethodPut)
-			fmt.Fprint(w, `{
-				"content": "content here",
-				"format": "asciidoc",
-				"slug": "deploy",
-				"title": "deploy title"
-			}`)
+			fmt.Fprint(w, `{"content":"content here","format":"asciidoc","slug":"deploy","title":"deploy title"}`)
 		})
 
 	groupwiki, _, err := client.GroupWikis.EditGroupWikiPage(1, "deploy", &EditGroupWikiPageOptions{
@@ -134,12 +93,7 @@ func TestEditGroupWikiPage(t *testing.T) {
 		t.Errorf("GroupWikis.EditGroupWikiPage returned error: %v", err)
 	}
 
-	want := &GroupWiki{
-		Content: "content here",
-		Format:  WikiFormatASCIIDoc,
-		Slug:    "deploy",
-		Title:   "deploy title",
-	}
+	want := &GroupWiki{Content: "content here", Format: WikiFormatASCIIDoc, Slug: "deploy", Title: "deploy title"}
 	if !reflect.DeepEqual(want, groupwiki) {
 		t.Errorf("GroupWikis.EditGroupWikiPage returned %+v, want %+v", groupwiki, want)
 	}
diff --git a/groups_test.go b/groups_test.go
index ccf0d82..ea22588 100644
--- a/groups_test.go
+++ b/groups_test.go
@@ -203,7 +203,7 @@ func TestListGroupProjects(t *testing.T) {
 	}
 }
 
-func TestListSubgroups(t *testing.T) {
+func TestListSubGroups(t *testing.T) {
 	mux, server, client := setup(t)
 	defer teardown(server)
 
@@ -213,14 +213,14 @@ func TestListSubgroups(t *testing.T) {
 			fmt.Fprint(w, `[{"id": 1}, {"id": 2}]`)
 		})
 
-	groups, _, err := client.Groups.ListSubgroups(1, &ListSubgroupsOptions{})
+	groups, _, err := client.Groups.ListSubGroups(1, &ListSubGroupsOptions{})
 	if err != nil {
-		t.Errorf("Groups.ListSubgroups returned error: %v", err)
+		t.Errorf("Groups.ListSubGroups returned error: %v", err)
 	}
 
 	want := []*Group{{ID: 1}, {ID: 2}}
 	if !reflect.DeepEqual(want, groups) {
-		t.Errorf("Groups.ListSubgroups returned %+v, want %+v", groups, want)
+		t.Errorf("Groups.ListSubGroups returned %+v, want %+v", groups, want)
 	}
 }
 
diff --git a/testdata/webhooks/subgroup.json b/testdata/webhooks/subgroup.json
index 0c336cd..a3c1e83 100644
--- a/testdata/webhooks/subgroup.json
+++ b/testdata/webhooks/subgroup.json
@@ -2,7 +2,7 @@
   "created_at": "2022-01-24T14:23:59Z",
   "updated_at": "2022-01-24T14:23:59Z",
   "event_name": "subgroup_create",
-  "name": "Subgroup 1",
+  "name": "SubGroup 1",
   "path": "subgroup-1",
   "full_path": "group-1/subgroup-1",
   "group_id": 2,
diff --git a/wikis_test.go b/wikis_test.go
index c249eb7..4d5caaa 100644
--- a/wikis_test.go
+++ b/wikis_test.go
@@ -30,22 +30,21 @@ func TestListWikis(t *testing.T) {
 		testMethod(t, r, http.MethodGet)
 		fmt.Fprintf(w, `[
 			{
-			  "content": "Here is an instruction how to deploy this project.",
-			  "format": "markdown",
-			  "slug": "deploy",
-			  "title": "deploy"
+			  "content" : "Here is an instruction how to deploy this project.",
+			  "format" : "markdown",
+			  "slug" : "deploy",
+			  "title" : "deploy"
 			},
 			{
-			  "content": "Our development process is described here.",
-			  "format": "markdown",
-			  "slug": "development",
-			  "title": "development"
-			},
-			{
-			  "content": "*  [Deploy](deploy)\n*  [Development](development)",
-			  "format": "markdown",
-			  "slug": "home",
-			  "title": "home"
+			  "content" : "Our development process is described here.",
+			  "format" : "markdown",
+			  "slug" : "development",
+			  "title" : "development"
+			},{
+			  "content" : "*  [Deploy](deploy)\n*  [Development](development)",
+			  "format" : "markdown",
+			  "slug" : "home",
+			  "title" : "home"
 			}
 		  ]`)
 	})
@@ -88,25 +87,23 @@ func TestGetWikiPage(t *testing.T) {
 	mux.HandleFunc("/api/v4/projects/1/wikis/home", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, http.MethodGet)
 		fmt.Fprintf(w, `{
-			"content": "home page",
-			"format": "markdown",
-			"slug": "home",
-			"title": "home",
-			"encoding": "UTF-8"
+			"content" : "home page",
+			"format" : "markdown",
+			"slug" : "home",
+			"title" : "home"
 		  }`)
 	})
 
-	wiki, _, err := client.Wikis.GetWikiPage(1, "home", &GetWikiPageOptions{})
+	wiki, _, err := client.Wikis.GetWikiPage(1, "home")
 	if err != nil {
 		t.Errorf("Wiki.GetWikiPage returned error: %v", err)
 	}
 
 	want := &Wiki{
-		Content:  "home page",
-		Encoding: "UTF-8",
-		Format:   "markdown",
-		Slug:     "home",
-		Title:    "home",
+		Content: "home page",
+		Format:  "markdown",
+		Slug:    "home",
+		Title:   "home",
 	}
 
 	if !reflect.DeepEqual(want, wiki) {
@@ -121,10 +118,10 @@ func TestCreateWikiPage(t *testing.T) {
 	mux.HandleFunc("/api/v4/projects/1/wikis", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, http.MethodPost)
 		fmt.Fprintf(w, `{
-			"content": "Hello world",
-			"format": "markdown",
-			"slug": "Hello",
-			"title": "Hello"
+			"content" : "Hello world",
+			"format" : "markdown",
+			"slug" : "Hello",
+			"title" : "Hello"
 		  }`)
 	})
 
@@ -157,10 +154,10 @@ func TestEditWikiPage(t *testing.T) {
 	mux.HandleFunc("/api/v4/projects/1/wikis/foo", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, http.MethodPut)
 		fmt.Fprintf(w, `{
-			"content": "documentation",
-			"format": "markdown",
-			"slug": "Docs",
-			"title": "Docs"
+			"content" : "documentation",
+			"format" : "markdown",
+			"slug" : "Docs",
+			"title" : "Docs"
 		  }`)
 	})