Files
decort-golang-sdk/pkg/cloudbroker/stpolicy/delete_replication_profile.go
dayterr bf932e5ef9 v1.16.4
v1.16.4
2026-09-18 16:49:20 +03:00

40 lines
1.0 KiB
Go

package stpolicy
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// DeleteReplicationProfileRequest struct to delete replication profile
type DeleteReplicationProfileRequest struct {
// ID of replication profile
// Required: true
ProfileID uint64 `url:"profile_id" json:"profile_id" validate:"required"`
}
// DeleteReplicationProfile deletes replication profile
func (sp StPolicy) DeleteReplicationProfile(ctx context.Context, req DeleteReplicationProfileRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/storage_policy/delete_replication_profile"
res, err := sp.client.DecortApiCallCtype(ctx, http.MethodPost, 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
}