chore: move '/internal/pkg' to '/pkg'
This commit is contained in:
37
pkg/sdk3rd/btwaf/api_modify_site.go
Normal file
37
pkg/sdk3rd/btwaf/api_modify_site.go
Normal file
@@ -0,0 +1,37 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user