refactor: clean code
This commit is contained in:
16
internal/pkg/sdk3rd/bunny/api.go
Normal file
16
internal/pkg/sdk3rd/bunny/api.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package bunnysdk
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func (c *Client) AddCustomCertificate(req *AddCustomCertificateRequest) ([]byte, error) {
|
||||
if req.PullZoneId == "" {
|
||||
return nil, fmt.Errorf("bunny api error: invalid parameter: PullZoneId")
|
||||
}
|
||||
|
||||
resp, err := c.sendRequest(http.MethodPost, fmt.Sprintf("/pullzone/%s/addCertificate", url.PathEscape(req.PullZoneId)), req)
|
||||
return resp.Body(), err
|
||||
}
|
||||
Reference in New Issue
Block a user