package p.packer.messages;

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

public record MoveAssetResult(
        PackerOperationStatus status,
        String summary,
        AssetReference assetReference,
        Path assetRoot,
        Path manifestPath) {

    public MoveAssetResult {
        Objects.requireNonNull(status, "status");
        summary = Objects.requireNonNull(summary, "summary").trim();
        if (summary.isBlank()) {
            throw new IllegalArgumentException("summary must not be blank");
        }
        if (assetRoot != null) {
            assetRoot = assetRoot.toAbsolutePath().normalize();
        }
        if (manifestPath != null) {
            manifestPath = manifestPath.toAbsolutePath().normalize();
        }
    }
}
