package com.atlassian.stash.internal.scm.git.command.tag;

import com.atlassian.bitbucket.i18n.I18nService;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.scm.git.command.GitScmCommandBuilder;
import com.atlassian.bitbucket.scm.git.command.tag.GitTag;
import com.atlassian.bitbucket.scm.git.command.tag.GitTagCreateBuilder;
import com.atlassian.bitbucket.scm.git.command.tag.GitTagDeleteBuilder;

import javax.annotation.Nonnull;

/**
 * @since 3.6
 */
public class DefaultGitTag implements GitTag {

    private final GitScmCommandBuilder builder;
    private final I18nService i18nService;
    private final Repository repository;

    public DefaultGitTag(GitScmCommandBuilder builder, I18nService i18nService, Repository repository) {
        this.builder = builder.command("tag");
        this.i18nService = i18nService;
        this.repository = repository;
    }

    @Nonnull
    @Override
    public GitTagCreateBuilder create(@Nonnull String name) {
        return new DefaultGitTagCreateBuilder(builder, i18nService, name, repository);
    }

    @Nonnull
    @Override
    public GitTagDeleteBuilder delete(@Nonnull String name) {
        return new DefaultGitTagDeleteBuilder(builder, i18nService, name, repository);
    }
}
