package p.studio.debug.runtime;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public record StudioRuntimeHandshakeRuntimeToClient(
        @JsonProperty("type") String type,
        @JsonProperty("protocol_version") int protocolVersion,
        @JsonProperty("runtime_version") String runtimeVersion) {

    public StudioRuntimeHandshakeRuntimeToClient {
        if (!"handshake".equals(type)) {
            throw new IllegalArgumentException("type must be 'handshake'");
        }
    }
}
