@@ -767,6 +767,103 @@ func (s *ServicesService) DeleteGithubService(pid interface{}, options ...Reques
767767 return s .client .Do (req , nil )
768768}
769769
770+ // HarborService represents the Harbor service settings.
771+ //
772+ // GitLab API docs:
773+ // https://docs.gitlab.com/ee/api/integrations.html#harbor
774+ type HarborService struct {
775+ Service
776+ Properties * HarborServiceProperties `json:"properties"`
777+ }
778+
779+ // HarborServiceProperties represents Harbor specific properties.
780+ //
781+ // GitLab API docs:
782+ // https://docs.gitlab.com/ee/api/integrations.html#harbor
783+ type HarborServiceProperties struct {
784+ URL string `json:"url"`
785+ ProjectName string `json:"project_name"`
786+ Username string `json:"username"`
787+ Password string `json:"password"`
788+ UseInheritedSettings bool `json:"use_inherited_settings"`
789+ }
790+
791+ // GetHarborService gets Harbor service settings for a project.
792+ //
793+ // GitLab API docs:
794+ // https://docs.gitlab.com/ee/api/integrations.html#get-harbor-settings
795+ func (s * ServicesService ) GetHarborService (pid interface {}, options ... RequestOptionFunc ) (* HarborService , * Response , error ) {
796+ project , err := parseID (pid )
797+ if err != nil {
798+ return nil , nil , err
799+ }
800+ u := fmt .Sprintf ("projects/%s/integrations/harbor" , PathEscape (project ))
801+
802+ req , err := s .client .NewRequest (http .MethodGet , u , nil , options )
803+ if err != nil {
804+ return nil , nil , err
805+ }
806+
807+ svc := new (HarborService )
808+ resp , err := s .client .Do (req , svc )
809+ if err != nil {
810+ return nil , resp , err
811+ }
812+
813+ return svc , resp , nil
814+ }
815+
816+ // SetHarborServiceOptions represents the available SetHarborService()
817+ // options.
818+ //
819+ // GitLab API docs:
820+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-harbor
821+ type SetHarborServiceOptions struct {
822+ URL * string `url:"url,omitempty" json:"url,omitempty"`
823+ ProjectName * string `url:"project_name,omitempty" json:"project_name,omitempty"`
824+ Username * string `url:"username,omitempty" json:"username,omitempty"`
825+ Password * string `url:"password,omitempty" json:"password,omitempty"`
826+ UseInheritedSettings * bool `url:"use_inherited_settings,omitempty" json:"use_inherited_settings,omitempty"`
827+ }
828+
829+ // SetHarborService sets Harbor service for a project.
830+ //
831+ // GitLab API docs:
832+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-harbor
833+ func (s * ServicesService ) SetHarborService (pid interface {}, opt * SetHarborServiceOptions , options ... RequestOptionFunc ) (* Response , error ) {
834+ project , err := parseID (pid )
835+ if err != nil {
836+ return nil , err
837+ }
838+ u := fmt .Sprintf ("projects/%s/integrations/harbor" , PathEscape (project ))
839+
840+ req , err := s .client .NewRequest (http .MethodPut , u , opt , options )
841+ if err != nil {
842+ return nil , err
843+ }
844+
845+ return s .client .Do (req , nil )
846+ }
847+
848+ // DeleteHarborService deletes Harbor service for a project.
849+ //
850+ // GitLab API docs:
851+ // https://docs.gitlab.com/ee/api/integrations.html#disable-harbor
852+ func (s * ServicesService ) DeleteHarborService (pid interface {}, options ... RequestOptionFunc ) (* Response , error ) {
853+ project , err := parseID (pid )
854+ if err != nil {
855+ return nil , err
856+ }
857+ u := fmt .Sprintf ("projects/%s/integrations/harbor" , PathEscape (project ))
858+
859+ req , err := s .client .NewRequest (http .MethodDelete , u , nil , options )
860+ if err != nil {
861+ return nil , err
862+ }
863+
864+ return s .client .Do (req , nil )
865+ }
866+
770867// SlackApplication represents GitLab for slack application settings.
771868//
772869// GitLab API docs:
0 commit comments