package com.atlassian.bitbucket.internal.tag;

import com.atlassian.bitbucket.repository.Ref;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.repository.Tag;
import com.atlassian.bitbucket.util.Page;

import javax.annotation.Nonnull;

/**
 * Provides some {@link Tag tag} specific services. Also see {@link com.atlassian.bitbucket.repository.RefService}
 * which hosts core tag services such as create tag and get tag.
 */
public interface TagService {

    /**
     * Finds tags which refer to the specified commits.
     *
     * @param repository the repository containing the tags
     * @param commitIds  the commits the tags refer to
     * @return a page of tags, which may be empty but never {@code null}
     */
    @Nonnull
    Page<Ref> findByCommits(@Nonnull Repository repository, @Nonnull Iterable<String> commitIds);
}
