@@ -39,43 +39,38 @@ type GroupsService struct {
39
39
//
40
40
// GitLab API docs: https://docs.gitlab.com/ee/api/groups.html
41
41
type Group struct {
42
- ID int `json:"id"`
43
- Name string `json:"name"`
44
- Path string `json:"path"`
45
- Description string `json:"description"`
46
- MembershipLock bool `json:"membership_lock"`
47
- Visibility VisibilityValue `json:"visibility"`
48
- LFSEnabled bool `json:"lfs_enabled"`
49
- DefaultBranch string `json:"default_branch"`
50
- DefaultBranchProtectionDefaults struct {
51
- AllowedToPush []* GroupAccessLevel `json:"allowed_to_push"`
52
- AllowForcePush bool `json:"allow_force_push"`
53
- AllowedToMerge []* GroupAccessLevel `json:"allowed_to_merge"`
54
- DeveloperCanInitialPush bool `json:"developer_can_initial_push"`
55
- } `json:"default_branch_protection_defaults"`
56
- AvatarURL string `json:"avatar_url"`
57
- WebURL string `json:"web_url"`
58
- RequestAccessEnabled bool `json:"request_access_enabled"`
59
- RepositoryStorage string `json:"repository_storage"`
60
- FullName string `json:"full_name"`
61
- FullPath string `json:"full_path"`
62
- FileTemplateProjectID int `json:"file_template_project_id"`
63
- ParentID int `json:"parent_id"`
64
- Projects []* Project `json:"projects"`
65
- Statistics * Statistics `json:"statistics"`
66
- CustomAttributes []* CustomAttribute `json:"custom_attributes"`
67
- ShareWithGroupLock bool `json:"share_with_group_lock"`
68
- RequireTwoFactorAuth bool `json:"require_two_factor_authentication"`
69
- TwoFactorGracePeriod int `json:"two_factor_grace_period"`
70
- ProjectCreationLevel ProjectCreationLevelValue `json:"project_creation_level"`
71
- AutoDevopsEnabled bool `json:"auto_devops_enabled"`
72
- SubGroupCreationLevel SubGroupCreationLevelValue `json:"subgroup_creation_level"`
73
- EmailsEnabled bool `json:"emails_enabled"`
74
- MentionsDisabled bool `json:"mentions_disabled"`
75
- RunnersToken string `json:"runners_token"`
76
- SharedProjects []* Project `json:"shared_projects"`
77
- SharedRunnersSetting SharedRunnersSettingValue `json:"shared_runners_setting"`
78
- SharedWithGroups []struct {
42
+ ID int `json:"id"`
43
+ Name string `json:"name"`
44
+ Path string `json:"path"`
45
+ Description string `json:"description"`
46
+ MembershipLock bool `json:"membership_lock"`
47
+ Visibility VisibilityValue `json:"visibility"`
48
+ LFSEnabled bool `json:"lfs_enabled"`
49
+ DefaultBranch string `json:"default_branch"`
50
+ DefaultBranchProtectionDefaults * BranchProtectionDefaults `json:"default_branch_protection_defaults"`
51
+ AvatarURL string `json:"avatar_url"`
52
+ WebURL string `json:"web_url"`
53
+ RequestAccessEnabled bool `json:"request_access_enabled"`
54
+ RepositoryStorage string `json:"repository_storage"`
55
+ FullName string `json:"full_name"`
56
+ FullPath string `json:"full_path"`
57
+ FileTemplateProjectID int `json:"file_template_project_id"`
58
+ ParentID int `json:"parent_id"`
59
+ Projects []* Project `json:"projects"`
60
+ Statistics * Statistics `json:"statistics"`
61
+ CustomAttributes []* CustomAttribute `json:"custom_attributes"`
62
+ ShareWithGroupLock bool `json:"share_with_group_lock"`
63
+ RequireTwoFactorAuth bool `json:"require_two_factor_authentication"`
64
+ TwoFactorGracePeriod int `json:"two_factor_grace_period"`
65
+ ProjectCreationLevel ProjectCreationLevelValue `json:"project_creation_level"`
66
+ AutoDevopsEnabled bool `json:"auto_devops_enabled"`
67
+ SubGroupCreationLevel SubGroupCreationLevelValue `json:"subgroup_creation_level"`
68
+ EmailsEnabled bool `json:"emails_enabled"`
69
+ MentionsDisabled bool `json:"mentions_disabled"`
70
+ RunnersToken string `json:"runners_token"`
71
+ SharedProjects []* Project `json:"shared_projects"`
72
+ SharedRunnersSetting SharedRunnersSettingValue `json:"shared_runners_setting"`
73
+ SharedWithGroups []struct {
79
74
GroupID int `json:"group_id"`
80
75
GroupName string `json:"group_name"`
81
76
GroupFullPath string `json:"group_full_path"`
@@ -101,6 +96,17 @@ type Group struct {
101
96
DefaultBranchProtection int `json:"default_branch_protection"`
102
97
}
103
98
99
+ // BranchProtectionDefaults represents default Git protected branch permissions.
100
+ //
101
+ // GitLab API docs:
102
+ // https://docs.gitlab.com/ee/api/groups.html#options-for-default_branch_protection_defaults
103
+ type BranchProtectionDefaults struct {
104
+ AllowedToPush []* GroupAccessLevel `json:"allowed_to_push,omitempty"`
105
+ AllowForcePush bool `json:"allow_force_push,omitempty"`
106
+ AllowedToMerge []* GroupAccessLevel `json:"allowed_to_merge,omitempty"`
107
+ DeveloperCanInitialPush bool `json:"developer_can_initial_push,omitempty"`
108
+ }
109
+
104
110
// GroupAccessLevel represents default branch protection defaults access levels.
105
111
//
106
112
// GitLab API docs:
0 commit comments