Skip to content

Commit 7ef9208

Browse files
committed
Add DeleteLicense API
1 parent 4ec1dc6 commit 7ef9208

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

license.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package gitlab
1818

1919
import (
20+
"fmt"
2021
"net/http"
2122
"time"
2223
)
@@ -110,3 +111,18 @@ func (s *LicenseService) AddLicense(opt *AddLicenseOptions, options ...RequestOp
110111

111112
return l, resp, err
112113
}
114+
115+
// DeleteLicense deletes an existing license.
116+
//
117+
// GitLab API docs:
118+
// https://docs.gitlab.com/ee/api/license.html#delete-a-license
119+
func (s *LicenseService) DeleteLicense(licenseID int, options ...RequestOptionFunc) (*Response, error) {
120+
u := fmt.Sprintf("license/%d", licenseID)
121+
122+
req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
123+
if err != nil {
124+
return nil, err
125+
}
126+
127+
return s.client.Do(req, nil)
128+
}

0 commit comments

Comments
 (0)