Skip to content

Commit

Permalink
Merge pull request #1574 from timofurrer/delete-license
Browse files Browse the repository at this point in the history
Add `DeleteLicense` API
  • Loading branch information
svanharmelen committed Dec 4, 2022
2 parents 1f30a79 + 7ef9208 commit ac5896f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions license.go
Expand Up @@ -17,6 +17,7 @@
package gitlab

import (
"fmt"
"net/http"
"time"
)
Expand Down Expand Up @@ -110,3 +111,18 @@ func (s *LicenseService) AddLicense(opt *AddLicenseOptions, options ...RequestOp

return l, resp, err
}

// DeleteLicense deletes an existing license.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/license.html#delete-a-license
func (s *LicenseService) DeleteLicense(licenseID int, options ...RequestOptionFunc) (*Response, error) {
u := fmt.Sprintf("license/%d", licenseID)

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 ac5896f

Please sign in to comment.