package com.atlassian.bitbucket.rest;

import com.atlassian.bitbucket.i18n.I18nService;

public class RestResource {

    protected final I18nService i18nService;

    public RestResource(I18nService i18nService) {
        this.i18nService = i18nService;
    }

    public NotFoundException noSuchRepoException(String projectKey, String repositorySlug) {
        return new NotFoundException(i18nService.getMessage("bitbucket.rest.nosuchrepo", projectKey, repositorySlug));
    }

    public NotFoundException noSuchProjectException(String projectKey) {
        return new NotFoundException(i18nService.getMessage("bitbucket.rest.nosuchproject", projectKey));
    }

    public NotFoundException noSuchUserException(String name) {
        return new NotFoundException(i18nService.getMessage("bitbucket.rest.nosuchuser", name));
    }

    public NotFoundException noSuchGroupException(String name) {
        return new NotFoundException(i18nService.getMessage("bitbucket.rest.nosuchgroup", name));
    }

    public NotFoundException noSuchPullRequestException(String projectKey, String repositorySlug, long pullRequestId) {
        return new NotFoundException(i18nService.getMessage("bitbucket.rest.nosuchpullrequest",
                pullRequestId, repositorySlug, projectKey));
    }

    public NotFoundException noSuchCommentException(long comment) {
        return new NotFoundException(i18nService.getMessage("bitbucket.rest.nosuchcomment", comment));
    }
}
