package p.studio.workspaces.assets.messages;

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

public record AssetWorkspaceBankCompositionDetails(
        List<AssetWorkspaceBankCompositionFile> availableFiles,
        List<AssetWorkspaceBankCompositionFile> selectedFiles,
        long measuredBankSizeBytes) {

    public static final AssetWorkspaceBankCompositionDetails EMPTY =
            new AssetWorkspaceBankCompositionDetails(List.of(), List.of(), 0L);

    public AssetWorkspaceBankCompositionDetails {
        availableFiles = List.copyOf(Objects.requireNonNull(availableFiles, "availableFiles"));
        selectedFiles = List.copyOf(Objects.requireNonNull(selectedFiles, "selectedFiles"));
        if (measuredBankSizeBytes < 0L) {
            throw new IllegalArgumentException("measuredBankSizeBytes must be non-negative");
        }
    }
}
