Skip to content

Commit

Permalink
Add DeletePackageFile in PackagesService
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Dupont committed Aug 9, 2022
1 parent ddb9cb0 commit dbc0011
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,22 @@ func (s *PackagesService) DeleteProjectPackage(pid interface{}, pkg int, options

return s.client.Do(req, nil)
}

// DeletePackageFile deletes a file in project package
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/packages.html#delete-a-package-file
func (s *PackagesService) DeletePackageFile(pid interface{}, pkg, file int, options ...RequestOptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/packages/%d/package_files/%d", PathEscape(project), pkg, file)

req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
if err != nil {
return nil, err
}

return s.client.Do(req, nil)
}

0 comments on commit dbc0011

Please sign in to comment.