mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-19 01:41:55 +08:00
38 lines
870 B
Go
38 lines
870 B
Go
package btwaf
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
type ModifySiteRequest struct {
|
|
SiteId *string `json:"site_id,omitempty"`
|
|
Type *string `json:"types,omitempty"`
|
|
Server *SiteServerInfo `json:"server,omitempty"`
|
|
}
|
|
|
|
type ModifySiteResponse struct {
|
|
apiResponseBase
|
|
}
|
|
|
|
func (c *Client) ModifySite(req *ModifySiteRequest) (*ModifySiteResponse, error) {
|
|
return c.ModifySiteWithContext(context.Background(), req)
|
|
}
|
|
|
|
func (c *Client) ModifySiteWithContext(ctx context.Context, req *ModifySiteRequest) (*ModifySiteResponse, error) {
|
|
httpreq, err := c.newRequest(http.MethodPost, "/wafmastersite/modify_site")
|
|
if err != nil {
|
|
return nil, err
|
|
} else {
|
|
httpreq.SetBody(req)
|
|
httpreq.SetContext(ctx)
|
|
}
|
|
|
|
result := &ModifySiteResponse{}
|
|
if _, err := c.doRequestWithResult(httpreq, result); err != nil {
|
|
return result, err
|
|
}
|
|
|
|
return result, nil
|
|
}
|