Skip to content

Commit 26519c9

Browse files
committed
Fixup the PR
1 parent d643424 commit 26519c9

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

protected_tags.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ type ProtectedTag struct {
4444
// GitLab API docs:
4545
// https://docs.gitlab.com/ee/api/protected_tags.html
4646
type TagAccessDescription struct {
47+
UserID int `json:"user_id"`
48+
GroupID int `json:"group_id"`
4749
AccessLevel AccessLevelValue `json:"access_level"`
4850
AccessLevelDescription string `json:"access_level_description"`
49-
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
50-
GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"`
5151
}
5252

5353
// ListProtectedTagsOptions represents the available ListProtectedTags()
@@ -113,16 +113,16 @@ func (s *ProtectedTagsService) GetProtectedTag(pid interface{}, tag string, opti
113113
// GitLab API docs:
114114
// https://docs.gitlab.com/ee/api/protected_tags.html#protect-repository-tags
115115
type ProtectRepositoryTagsOptions struct {
116-
Name *string `url:"name" json:"name"`
117-
CreateAccessLevel *AccessLevelValue `url:"create_access_level,omitempty" json:"create_access_level,omitempty"`
118-
AllowedToCreate *[]ProtectRepositoryTagsPermissionOptions `url:"allowed_to_create,omitempty" json:"allowed_to_create,omitempty"`
116+
Name *string `url:"name,omitempty" json:"name,omitempty"`
117+
CreateAccessLevel *AccessLevelValue `url:"create_access_level,omitempty" json:"create_access_level,omitempty"`
118+
AllowedToCreate *[]*TagsPermissionOptions `url:"allowed_to_create,omitempty" json:"allowed_to_create,omitempty"`
119119
}
120120

121-
// ProtectRepositoryTagsPermissionOptions represents a protected tag permission option.
121+
// TagsPermissionOptions represents a protected tag permission option.
122122
//
123123
// GitLab API docs:
124124
// https://docs.gitlab.com/ee/api/protected_tags.html#protect-repository-tags
125-
type ProtectRepositoryTagsPermissionOptions struct {
125+
type TagsPermissionOptions struct {
126126
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
127127
GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"`
128128
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`

protected_tags_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestGetProtectedTag(t *testing.T) {
8080
},
8181
{
8282
AccessLevel: 40,
83-
GroupID: Int(300),
83+
GroupID: 300,
8484
AccessLevelDescription: "Sample Group",
8585
},
8686
},
@@ -110,7 +110,7 @@ func TestProtectRepositoryTags(t *testing.T) {
110110
},
111111
{
112112
AccessLevel: 40,
113-
GroupID: Int(300),
113+
GroupID: 300,
114114
AccessLevelDescription: "Sample Group",
115115
},
116116
},
@@ -119,7 +119,7 @@ func TestProtectRepositoryTags(t *testing.T) {
119119
opt := &ProtectRepositoryTagsOptions{
120120
Name: String("my-awesome-tag"),
121121
CreateAccessLevel: AccessLevel(30),
122-
AllowedToCreate: &[]ProtectRepositoryTagsPermissionOptions{
122+
AllowedToCreate: &[]*TagsPermissionOptions{
123123
{
124124
GroupID: Int(300),
125125
},

0 commit comments

Comments
 (0)