package p.packer.models;

import java.util.List;
import java.util.Objects;

public record PackerDeleteAssetEvaluation(
        PackerResolvedAssetReference resolved,
        List<PackerDiagnostic> diagnostics,
        boolean canDelete,
        String reason) {

    public PackerDeleteAssetEvaluation {
        Objects.requireNonNull(resolved, "resolved");
        diagnostics = List.copyOf(Objects.requireNonNull(diagnostics, "diagnostics"));
        reason = reason == null ? null : reason.trim();
        if (reason != null && reason.isBlank()) {
            reason = null;
        }
    }
}
