public ExportMessagesCommand buildFromRequest(MessagesRequest request) {
        ExportMessagesCommand.Builder builder = ExportMessagesCommand.builder()
                .timeRange(toAbsolute(request.timeRange()))
                .queryString(request.queryString())
                .streams(request.streams())
                .fieldsInOrder(request.fieldsInOrder())
                .chunkSize(request.chunkSize());

        request.timeZone().ifPresent(builder::timeZone);
        request.limit().ifPresent(builder::limit);

        return builder.build();
    }
@Test
    void buildsCommandFromRequest() {
        MessagesRequest request = MessagesRequest.builder().build();
        ExportMessagesCommand command = sut.buildFromRequest(request);

        assertAll(
                () -> assertThat(command.queryString()).isEqualTo(request.queryString()),
                () -> assertThat(command.streams()).isEqualTo(request.streams()),
                () -> assertThat(command.fieldsInOrder()).isEqualTo(request.fieldsInOrder()),
                () -> assertThat(command.limit()).isEqualTo(request.limit()),
                () -> assertThat(command.chunkSize()).isEqualTo(request.chunkSize())
        );
    }