This commit is contained in:
2026-08-21 17:52:28 +04:00
parent d7b8f08b4d
commit eb195dd992
116 changed files with 2719 additions and 1973 deletions

View File

@@ -0,0 +1,41 @@
package qospolicy
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
type DeleteRuleRequest struct {
// ID of the QoS policy
// Required: true
QoSPolicyID uint64 `url:"qos_policy_id" json:"qos_policy_id" validate:"required"`
// ID of the rule to delete
// Required: true
RuleID uint64 `url:"rule_id" json:"rule_id" validate:"required"`
}
func (qp QoSPolicy) DeleteRule(ctx context.Context, req DeleteRuleRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/network_qos_policy/delete_rule"
res, err := qp.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}