package com.atlassian.stash.internal.pull;

import com.atlassian.bitbucket.commit.Commit;
import com.atlassian.bitbucket.idx.CommitIndex;
import com.atlassian.bitbucket.pull.PullRequest;
import com.atlassian.bitbucket.pull.PullRequestCommitEnricher;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;

/**
 * @since 4.8
 */
public interface InternalPullRequestCommitEnricher extends PullRequestCommitEnricher {

    /**
     * Enrich a collection of commits with properties from the {@link CommitIndex}.
     *
     * @param pullRequest  the pull request the {@link Commit commits} were retrieved from
     * @param commits      the commits to enrich
     * @param propertyKeys keys for {@link CommitIndex CommitIndex} properties to load
     * @return the enriched commits
     */
    @Nonnull
    Iterable<Commit> enrichAll(@Nonnull PullRequest pullRequest, @Nonnull Iterable<Commit> commits,
                               @Nullable Collection<String> propertyKeys);
}
