package p.studio.workspaces.assets.messages;

import p.packer.messages.AssetReference;

import java.util.Objects;

public record AssetWorkspaceDetailsViewState(
        AssetWorkspaceDetailsStatus detailsStatus,
        AssetReference selectedAssetReference,
        AssetWorkspaceAssetDetails selectedAssetDetails,
        String detailsErrorMessage) {

    public AssetWorkspaceDetailsViewState {
        Objects.requireNonNull(detailsStatus, "detailsStatus");
    }

    public AssetWorkspaceDetailsViewState withSelectedAssetReference(AssetWorkspaceAssetDetails selectedAssetDetails) {
        return new AssetWorkspaceDetailsViewState(detailsStatus, selectedAssetReference, selectedAssetDetails, detailsErrorMessage);
    }
}
