package p.packer.messages;

import p.packer.dtos.PackerAssetActionAvailabilityDTO;
import p.packer.dtos.PackerDiagnosticDTO;

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

public record GetAssetActionsResult(
        PackerOperationStatus status,
        String summary,
        List<PackerAssetActionAvailabilityDTO> actions,
        List<PackerDiagnosticDTO> diagnostics) {

    public GetAssetActionsResult {
        Objects.requireNonNull(status, "status");
        summary = Objects.requireNonNull(summary, "summary").trim();
        actions = List.copyOf(Objects.requireNonNull(actions, "actions"));
        diagnostics = List.copyOf(Objects.requireNonNull(diagnostics, "diagnostics"));
        if (summary.isBlank()) {
            throw new IllegalArgumentException("summary must not be blank");
        }
    }
}
