public Map<String, Long> importAllMedia(
      UUID jobId,
      IdempotentImportExecutor idempotentImportExecutor,
      Collection<? extends DownloadableFile> downloadableFiles,
      @NotNull final String dataClass)
      throws Exception {
    long successMediaCount = 0;
    long successMediaSize = 0;
    // todo: Currently we won't fail photo import if its album hasn't been imported
    List<DownloadableFile> newFiles =
        downloadableFiles.stream()
            .filter(
                downloadableFile ->
                    !idempotentImportExecutor.isKeyCached(downloadableFile.getIdempotentId()))
            .collect(Collectors.toList());

    UnmodifiableIterator<List<DownloadableFile>> batches =
        Iterators.partition(newFiles.iterator(), ApplePhotosConstants.maxNewMediaRequests);
    while (batches.hasNext()) {
      final Map<String, Long> batchImportResults =
          importMediaBatch(jobId, batches.next(), idempotentImportExecutor, dataClass);
      successMediaSize += batchImportResults.get(ApplePhotosConstants.BYTES_KEY);
      successMediaCount += batchImportResults.get(ApplePhotosConstants.COUNT_KEY);
    }

    final Map<String, Long> importResults =
        new ImmutableMap.Builder<String, Long>()
            .put(ApplePhotosConstants.BYTES_KEY, successMediaSize)
            .put(ApplePhotosConstants.COUNT_KEY, successMediaCount)
            .build();
    return importResults;
  }
An interface that is synonymous to HTTP client to interact with the Apple Photos APIs.
extensions/data-transfer/portability-data-transfer-apple/src/main/java/org/datatransferproject/datatransfer/apple/photos/AppleMediaInterface.java