public CreateMediaResponse createMedia(
      @NotNull final String jobId,
      @NotNull final String dataClass,
      @NotNull final List<NewMediaRequest> newMediaRequestList)
      throws IOException, CopyExceptionWithFailureReason {
    // createMedia
    final CreateMediaRequest.Builder createMediaRequestBuilder = CreateMediaRequest.newBuilder();

    // take jobId as importSessionId
    createMediaRequestBuilder.setImportSessionId(jobId);
    createMediaRequestBuilder.setDataClass(dataClass);
    createMediaRequestBuilder.addAllNewMediaRequests(newMediaRequestList);
    CreateMediaRequest createMediaRequest = createMediaRequestBuilder.build();

    for (NewMediaRequest newMediaRequest: newMediaRequestList) {
      monitor.debug(() -> "AppleMediaImporter send data to Apple Photos Service",
              AuditKeys.dataId, newMediaRequest.getDataId(),
              AuditKeys.updatedTimeInMs, newMediaRequest.getCreationDateInMillis());
    }

    final byte[] payload = createMediaRequest.toByteArray();

    final byte[] responseData = makePhotosServicePostRequest(baseUrl + "createmedia", payload);
    return CreateMediaResponse.parseFrom(responseData);
  }
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