package com.atlassian.bitbucket.rest.pull;

import com.atlassian.bitbucket.pull.DuplicatePullRequestException;
import com.atlassian.bitbucket.rest.annotation.JsonSurrogate;
import com.atlassian.bitbucket.rest.RestErrorMessage;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize
@JsonSurrogate(DuplicatePullRequestException.class)
public class RestDuplicatePullRequestErrorMessage extends RestErrorMessage {

    public RestDuplicatePullRequestErrorMessage(DuplicatePullRequestException exception) {
        super(exception);

        put("existingPullRequest", new RestPullRequest(exception.getExistingPullRequest()));
    }

}
