@Override
  public ImportResult importItem(
      UUID jobId,
      IdempotentImportExecutor idempotentExecutor,
      TokensAndUrlAuthData authData,
      MediaContainerResource data)
      throws Exception {
    if (data == null) {
      return ImportResult.OK;
    }

    for (PhotoModel photoModel: data.getPhotos()) {
      monitor.debug(() -> "AppleMediaImporter received data",
              AuditKeys.dataId, photoModel.getDataId(),
              AuditKeys.updatedTimeInMs, photoModel.getUploadedTime());
    }

    AppleMediaInterface mediaInterface = factory
      .getOrCreateMediaInterface(jobId, authData, appCredentials, exportingService, monitor);

    final int albumCount =
        mediaInterface.importAlbums(
            jobId,
            idempotentExecutor,
            data.getAlbums(),
          DataVertical.MEDIA.getDataType());
    final Map<String, Long> importPhotosMap =
        mediaInterface.importAllMedia(
            jobId,
            idempotentExecutor,
            data.getPhotos(),
          DataVertical.MEDIA.getDataType());
    final Map<String, Long> importVideosResult =
        mediaInterface.importAllMedia(
            jobId,
            idempotentExecutor,
            data.getVideos(),
          DataVertical.MEDIA.getDataType());

    final Map<String, Integer> counts =
        new ImmutableMap.Builder<String, Integer>()
            .put(MediaContainerResource.ALBUMS_COUNT_DATA_NAME, albumCount)
            .put(
                MediaContainerResource.PHOTOS_COUNT_DATA_NAME,
                importPhotosMap.getOrDefault(ApplePhotosConstants.COUNT_KEY, 0L).intValue())
            .put(
                MediaContainerResource.VIDEOS_COUNT_DATA_NAME,
                importVideosResult.getOrDefault(ApplePhotosConstants.COUNT_KEY, 0L).intValue())
            .build();

    monitor.info(() -> "AppleMediaImporter imported batch",
            MediaContainerResource.ALBUMS_COUNT_DATA_NAME, albumCount,
            MediaContainerResource.PHOTOS_COUNT_DATA_NAME, importPhotosMap.getOrDefault(ApplePhotosConstants.COUNT_KEY, 0L).intValue(),
            MediaContainerResource.VIDEOS_COUNT_DATA_NAME, importVideosResult.getOrDefault(ApplePhotosConstants.COUNT_KEY, 0L).intValue());

    return ImportResult.OK
        .copyWithBytes(
            importPhotosMap.getOrDefault(ApplePhotosConstants.BYTES_KEY, 0L)
                + importVideosResult.getOrDefault(ApplePhotosConstants.BYTES_KEY, 0L))
        .copyWithCounts(counts);
  }
An Apple importer to import the Photos and Videos into Apple iCloud-photos.
extensions/data-transfer/portability-data-transfer-apple/src/main/java/org/datatransferproject/datatransfer/apple/photos/AppleMediaImporter.java