package p.packer.messages;

import p.packer.dtos.PackerPackExecutionSummaryDTO;

import java.util.Objects;

public record PackWorkspaceResult(
        PackerOperationStatus status,
        String summary,
        PackerPackExecutionSummaryDTO result) {

    public PackWorkspaceResult {
        Objects.requireNonNull(status, "status");
        summary = Objects.requireNonNull(summary, "summary").trim();
        Objects.requireNonNull(result, "result");
        if (summary.isBlank()) {
            throw new IllegalArgumentException("summary must not be blank");
        }
    }
}
