package p.packer.models;

import java.util.Objects;

public record PackerAssetArtifactSelection(
        String file,
        int index) {

    public PackerAssetArtifactSelection {
        file = Objects.requireNonNull(file, "file").trim();
        if (file.isBlank()) {
            throw new IllegalArgumentException("file must not be blank");
        }
        if (index < 0) {
            throw new IllegalArgumentException("index must be non-negative");
        }
    }
}
