mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-17 09:59:51 +00:00
38 lines
882 B
Go
38 lines
882 B
Go
package icdn
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
type UpdateDomainRequest struct {
|
|
Domain *string `json:"domain,omitempty"`
|
|
HttpsStatus *string `json:"https_status,omitempty"`
|
|
CertName *string `json:"cert_name,omitempty"`
|
|
}
|
|
|
|
type UpdateDomainResponse struct {
|
|
baseResult
|
|
}
|
|
|
|
func (c *Client) UpdateDomain(req *UpdateDomainRequest) (*UpdateDomainResponse, error) {
|
|
return c.UpdateDomainWithContext(context.Background(), req)
|
|
}
|
|
|
|
func (c *Client) UpdateDomainWithContext(ctx context.Context, req *UpdateDomainRequest) (*UpdateDomainResponse, error) {
|
|
httpreq, err := c.newRequest(http.MethodPost, "/v1/domain/update-domain")
|
|
if err != nil {
|
|
return nil, err
|
|
} else {
|
|
httpreq.SetBody(req)
|
|
httpreq.SetContext(ctx)
|
|
}
|
|
|
|
result := &UpdateDomainResponse{}
|
|
if _, err := c.doRequestWithResult(httpreq, result); err != nil {
|
|
return result, err
|
|
}
|
|
|
|
return result, nil
|
|
}
|