@ApiOperation(value = "Perform simple query on event data", request = AnalyzeRequest.class, consumes = "text/event-stream", produces = "text/event-stream", authorizations = @Authorization(value = "read_key") ) @GET @IgnoreApi @Path("/analyze/export") public void exportEvents(RakamHttpRequest request, @QueryParam("read_key") String readKey) { queryService.handleServerSentQueryExecution(request, AnalyzeRequest.class, (project, analyzeRequest) -> { checkArgument(!analyzeRequest.collections.isEmpty(), "collections array is empty"); return eventExplorer.export(new RequestContext(project, readKey), analyzeRequest.collections, analyzeRequest.measure, analyzeRequest.grouping, analyzeRequest.segment, analyzeRequest.filterExpression, analyzeRequest.startDate, analyzeRequest.endDate, Optional.ofNullable(analyzeRequest.timezone).orElse(ZoneOffset.UTC)); }); }