package p.packer.models;

import java.nio.file.Path;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

public record PackerResolvedAssetReference(
        Path assetRoot,
        Optional<PackerRegistryEntry> registryEntry,
        Optional<PackerRuntimeAsset> runtimeAsset,
        List<PackerDiagnostic> diagnostics) {

    public PackerResolvedAssetReference {
        assetRoot = Objects.requireNonNull(assetRoot, "assetRoot").toAbsolutePath().normalize();
        registryEntry = Objects.requireNonNull(registryEntry, "registryEntry");
        runtimeAsset = Objects.requireNonNull(runtimeAsset, "runtimeAsset");
        diagnostics = List.copyOf(Objects.requireNonNull(diagnostics, "diagnostics"));
    }
}
