class WriteTxnMarkersRequest extends AbstractRequest {

    public List<TxnMarkerEntry> markers() {
        List<TxnMarkerEntry> markers = new ArrayList<>();
        for (WritableTxnMarker markerEntry : data.markers()) {
            List<TopicPartition> topicPartitions = new ArrayList<>();
            for (WritableTxnMarkerTopic topic : markerEntry.topics()) {
                for (Integer partitionIdx : topic.partitionIndexes()) {
                    topicPartitions.add(new TopicPartition(topic.name(), partitionIdx));
                }
            }
            markers.add(new TxnMarkerEntry(
                markerEntry.producerId(),
                markerEntry.producerEpoch(),
                markerEntry.coordinatorEpoch(),
                TransactionResult.forId(markerEntry.transactionResult()),
                topicPartitions)
            );
        }
        return markers;
    }

    private  WriteTxnMarkersRequest(WriteTxnMarkersRequestData data, short version);
    public  WriteTxnMarkersRequest(Struct struct, short version);

}