package com.atlassian.bitbucket.internal.branch.automerge.result;

import com.atlassian.bitbucket.branch.automerge.AutomaticMergeStopReason;
import com.atlassian.bitbucket.pull.PullRequest;

/**
 * A pull request was already open for a given merge.
 */
public class OpenPullRequestReason implements StopReason {

    private final PullRequest pullRequest;

    public OpenPullRequestReason(PullRequest pullRequest) {
        this.pullRequest = pullRequest;
    }

    @Override
    public AutomaticMergeStopReason getApiReason() {
        return AutomaticMergeStopReason.OPEN_PULL_REQUEST;
    }

    public PullRequest getPullRequest() {
        return pullRequest;
    }
}
