chore: move '/internal/pkg' to '/pkg'
This commit is contained in:
38
pkg/sdk3rd/ctyun/lvdn/api_update_domain.go
Normal file
38
pkg/sdk3rd/ctyun/lvdn/api_update_domain.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package lvdn
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type UpdateDomainRequest struct {
|
||||
Domain *string `json:"domain,omitempty"`
|
||||
ProductCode *string `json:"product_code,omitempty"`
|
||||
HttpsSwitch *int32 `json:"https_switch,omitempty"`
|
||||
CertName *string `json:"cert_name,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateDomainResponse struct {
|
||||
apiResponseBase
|
||||
}
|
||||
|
||||
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, "/live/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
|
||||
}
|
||||
Reference in New Issue
Block a user