/** * Returns the list of build triggers for a project. * * @param project the project * @return list of build triggers * @throws IllegalStateException if jobs are not enabled for the project */ public List<GitlabTrigger> getPipelineTriggers(GitlabProject project) { if (!project.isJobsEnabled()) { // if the project has not allowed jobs, you will only get a 403 forbidden message which is // not helpful. throw new IllegalStateException("Jobs are not enabled for " + project.getNameWithNamespace()); } else { return retrieve().getAll(GitlabProject.URL + "/" + project.getId() + GitlabTrigger.URL + PARAM_MAX_ITEMS_PER_PAGE, GitlabTrigger[].class); } }
/** * Returns the list of build triggers for a project. * * @param project the project * @return list of build triggers * @throws IllegalStateException if jobs are not enabled for the project */ public List<GitlabTrigger> getPipelineTriggers(GitlabProject project) { if (!project.isJobsEnabled()) { // if the project has not allowed jobs, you will only get a 403 forbidden message which is // not helpful. throw new IllegalStateException("Jobs are not enabled for " + project.getNameWithNamespace()); } else { return retrieve().getAll(GitlabProject.URL + "/" + project.getId() + GitlabTrigger.URL + PARAM_MAX_ITEMS_PER_PAGE, GitlabTrigger[].class); } }
/** * Returns the list of build triggers for a project. * * @param project the project * @return list of build triggers * @throws IllegalStateException if jobs are not enabled for the project */ public List<GitlabTrigger> getPipelineTriggers(GitlabProject project) { if (!project.isJobsEnabled()) { // if the project has not allowed jobs, you will only get a 403 forbidden message which is // not helpful. throw new IllegalStateException("Jobs are not enabled for " + project.getNameWithNamespace()); } else { return retrieve().getAll(GitlabProject.URL + "/" + project.getId() + GitlabTrigger.URL + PARAM_MAX_ITEMS_PER_PAGE, GitlabTrigger[].class); } }
.appendIf("issues_enabled", project.isIssuesEnabled()) .appendIf("merge_requests_enabled", project.isMergeRequestsEnabled()) .appendIf("jobs_enabled", project.isJobsEnabled()) .appendIf("wiki_enabled", project.isWikiEnabled()) .appendIf("snippets_enabled", project.isSnippetsEnabled())
.appendIf("issues_enabled", project.isIssuesEnabled()) .appendIf("merge_requests_enabled", project.isMergeRequestsEnabled()) .appendIf("jobs_enabled", project.isJobsEnabled()) .appendIf("wiki_enabled", project.isWikiEnabled()) .appendIf("snippets_enabled", project.isSnippetsEnabled())
.appendIf("issues_enabled", project.isIssuesEnabled()) .appendIf("merge_requests_enabled", project.isMergeRequestsEnabled()) .appendIf("jobs_enabled", project.isJobsEnabled()) .appendIf("wiki_enabled", project.isWikiEnabled()) .appendIf("snippets_enabled", project.isSnippetsEnabled())