From 15d4f084ab9f897a937e3b8880260511d630c849 Mon Sep 17 00:00:00 2001 From: Evan Wies Date: Sun, 21 Nov 2021 10:59:40 -0500 Subject: [PATCH] Add select support to Generic Packages --- generic_packages.go | 1 + types.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/generic_packages.go b/generic_packages.go index a8b84cc39..f4317a8b6 100644 --- a/generic_packages.go +++ b/generic_packages.go @@ -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. diff --git a/types.go b/types.go index bf6d53472..eaa3217b7 100644 --- a/types.go +++ b/types.go @@ -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