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

Commit

Permalink
Add select support to Generic Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
neomantra committed Nov 21, 2021
1 parent 9dc1b19 commit 15d4f08
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions generic_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type GenericPackagesService struct {
// https://docs.gitlab.com/ee/user/packages/generic_packages/index.html#download-package-file
type PublishPackageFileOptions struct {
Status *GenericPackageStatusValue `url:"status,omitempty" json:"status,omitempty"`
Select *GenericPackageSelectValue `url:"select,omitempty" json:"select,omitempty"`
}

// PublishPackageFile uploads a file to a project's package registry.
Expand Down
16 changes: 16 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ func FileAction(v FileActionValue) *FileActionValue {
return p
}

// GenericPackageSelectValue represents a GitLab Package Status.
type GenericPackageSelectValue string

// The available generic package statuses.
const (
SelectPackageFile GenericPackageSelectValue = "package_file"
)

// GenericPackageStatus is a helper routine that allocates a new GenericPackageStatusValue
// value to store v and returns a pointer to it.
func GenericPackageSelect(v GenericPackageSelectValue) *GenericPackageSelectValue {
p := new(GenericPackageSelectValue)
*p = v
return p
}

// GenericPackageStatusValue represents a GitLab Package Status.
type GenericPackageStatusValue string

Expand Down

0 comments on commit 15d4f08

Please sign in to comment.