public static NewMediaRequest createNewMediaRequest(
      @Nullable final String dataId,
      @Nullable final String filename,
      @Nullable final String description,
      @Nullable final String albumId,
      @Nullable final String mediaType,
      @Nullable final String encodingFormat,
      @Nullable final Long creationDateInMillis,
      @Nullable final String singleFileUploadResponse,
      final boolean isFavorite) {

    final NewMediaRequest.Builder newMediaRequest = NewMediaRequest.newBuilder();

    if (dataId != null) {
      newMediaRequest.setDataId(dataId);
    }

    if (filename != null) {
      newMediaRequest.setFilename(filename);
    }

    if (singleFileUploadResponse != null) {
      newMediaRequest.setSingleFileUploadResponse(singleFileUploadResponse);
    }

    if (description != null) {
      newMediaRequest.setDescription(description);
    }

    if (albumId != null) {
      newMediaRequest.setAlbumId(albumId);
    }

    if (creationDateInMillis != null) {
      newMediaRequest.setCreationDateInMillis(creationDateInMillis);
    }

    if (mediaType != null) {
      newMediaRequest.setMediaType(mediaType);
    }

    if (encodingFormat != null) {
      newMediaRequest.setEncodingFormat(encodingFormat);
    }

    newMediaRequest.setIsFavorite(isFavorite == true ? 1L: 0L);

    return newMediaRequest.build();
  }
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