Skip to content

Commit

Permalink
Fixup the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Oct 29, 2022
1 parent d643424 commit 26519c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions protected_tags.go
Expand Up @@ -44,10 +44,10 @@ type ProtectedTag struct {
// GitLab API docs:
// https://docs.gitlab.com/ee/api/protected_tags.html
type TagAccessDescription struct {
UserID int `json:"user_id"`
GroupID int `json:"group_id"`
AccessLevel AccessLevelValue `json:"access_level"`
AccessLevelDescription string `json:"access_level_description"`
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"`
}

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

// ProtectRepositoryTagsPermissionOptions represents a protected tag permission option.
// TagsPermissionOptions represents a protected tag permission option.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/protected_tags.html#protect-repository-tags
type ProtectRepositoryTagsPermissionOptions struct {
type TagsPermissionOptions struct {
UserID *int `url:"user_id,omitempty" json:"user_id,omitempty"`
GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"`
AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions protected_tags_test.go
Expand Up @@ -80,7 +80,7 @@ func TestGetProtectedTag(t *testing.T) {
},
{
AccessLevel: 40,
GroupID: Int(300),
GroupID: 300,
AccessLevelDescription: "Sample Group",
},
},
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestProtectRepositoryTags(t *testing.T) {
},
{
AccessLevel: 40,
GroupID: Int(300),
GroupID: 300,
AccessLevelDescription: "Sample Group",
},
},
Expand All @@ -119,7 +119,7 @@ func TestProtectRepositoryTags(t *testing.T) {
opt := &ProtectRepositoryTagsOptions{
Name: String("my-awesome-tag"),
CreateAccessLevel: AccessLevel(30),
AllowedToCreate: &[]ProtectRepositoryTagsPermissionOptions{
AllowedToCreate: &[]*TagsPermissionOptions{
{
GroupID: Int(300),
},
Expand Down

0 comments on commit 26519c9

Please sign in to comment.