mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-25 04:17:58 +00:00
refactor: reimpl 3rd sdks
This commit is contained in:
11
internal/pkg/vendors/cachefly-sdk/api.go
vendored
11
internal/pkg/vendors/cachefly-sdk/api.go
vendored
@@ -1,19 +1,14 @@
|
||||
package cacheflysdk
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (c *Client) CreateCertificate(req *CreateCertificateRequest) (*CreateCertificateResponse, error) {
|
||||
params := make(map[string]any)
|
||||
jsonData, _ := json.Marshal(req)
|
||||
json.Unmarshal(jsonData, ¶ms)
|
||||
|
||||
result := CreateCertificateResponse{}
|
||||
err := c.sendRequestWithResult(http.MethodPost, "/certificates", params, &result)
|
||||
resp := CreateCertificateResponse{}
|
||||
err := c.sendRequestWithResult(http.MethodPost, "/certificates", req, &resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
return &resp, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user