mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-19 01:41:55 +08:00
28 lines
656 B
Go
28 lines
656 B
Go
package unicloud
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type CreateDomainWithCertRequest struct {
|
|
Provider string `json:"provider"`
|
|
SpaceId string `json:"spaceId"`
|
|
Domain string `json:"domain"`
|
|
Cert string `json:"cert"`
|
|
Key string `json:"key"`
|
|
}
|
|
|
|
type CreateDomainWithCertResponse struct {
|
|
apiResponseBase
|
|
}
|
|
|
|
func (c *Client) CreateDomainWithCert(req *CreateDomainWithCertRequest) (*CreateDomainWithCertResponse, error) {
|
|
if err := c.ensureApiUserTokenExists(); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
resp := &CreateDomainWithCertResponse{}
|
|
err := c.sendRequestWithResult(http.MethodPost, "/host/create-domain-with-cert", req, resp)
|
|
return resp, err
|
|
}
|