private File downloadExportJson(DownloadBean downloadBean) throws IOException {
        LOGGER.info("Successfully triggered an export operation on the Manager API.");

        HttpUrl downloadUrl = HttpUrl.parse(endpoint)
            .newBuilder()
            .addPathSegment("downloads")
            // ID from DownloadBean is ID path segment
            .addPathSegment(downloadBean.getId())
            .build();

        Request downloadRequest = buildRequest(downloadUrl);
        Call downloadCall = client.newCall(downloadRequest);
        Response downloadResponse = downloadCall.execute();

        checkStatusOk(downloadResponse);

        File downloadedFileTmp = File.createTempFile("EnrichPre21Export", ".json");

        // Get the underlying okio source, as it has some nice methods for writing directly without loads of copying.
        BufferedSource source = downloadResponse.body().source();
        BufferedSink buff = Okio.buffer(Okio.sink(downloadedFileTmp));
        buff.writeAll(source);
        buff.close();

        LOGGER.debug("Successfully downloaded an Apiman export to tmp: {}", downloadedFileTmp);

        return downloadedFileTmp;
    }
Enrich pre-2.1.0.Final release.

Adds the missing ApiDefinition field to older Apiman export files.

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
migration-assistant/src/main/java/io/apiman/migration/fix_pre_21/EnrichPre21ExportCommand.java