class StopReplicaRequest extends AbstractControlRequest {

    @Override
    public StopReplicaResponse getErrorResponse(int throttleTimeMs, Throwable e) {
        Errors error = Errors.forException(e);

        StopReplicaResponseData data = new StopReplicaResponseData();
        data.setErrorCode(error.code());

        List<StopReplicaPartitionError> partitions = new ArrayList<>();
        for (StopReplicaTopicState topic : topicStates()) {
            for (StopReplicaPartitionState partition : topic.partitionStates()) {
                partitions.add(new StopReplicaPartitionError()
                    .setTopicName(topic.topicName())
                    .setPartitionIndex(partition.partitionIndex())
                    .setErrorCode(error.code()));
            }
        }
        data.setPartitionErrors(partitions);

        return new StopReplicaResponse(data);
    }

    private  StopReplicaRequest(StopReplicaRequestData data, short version);
    public  StopReplicaRequest(Struct struct, short version);

}