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 }