package rg import ( "context" "errors" "net/http" "strconv" ) type DisableRequest struct { RGID uint64 `url:"rgId"` Reason string `url:"reason,omitempty"` } func (rgrq DisableRequest) Validate() error { if rgrq.RGID == 0 { return errors.New("field RGID can not be empty or equal to 0") } return nil } func (r RG) Disable(ctx context.Context, req DisableRequest) (bool, error) { if err := req.Validate(); err != nil { return false, err } url := "/cloudapi/rg/disable" res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req) if err != nil { return false, err } return strconv.ParseBool(string(res)) }