Skip to content

Commit 333f1e5

Browse files
mdeknowisgmessner
authored andcommitted
Add support for resolve_outdated_diff_discussions in Project (#263)
* Add support for resolve_outdated_diff_discussions in Project * Add support for initialize_with_readme in Project
1 parent 32801a0 commit 333f1e5

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

src/main/java/org/gitlab4j/api/ProjectApi.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ public Project createProject(Project project) throws GitLabApiException {
655655
* repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins
656656
* approvalsBeforeMerge (optional) - How many approvers should approve merge request by default
657657
* printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line
658+
* resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push
659+
* initialize_with_readme (optional) - Initialize project with README file
658660
*
659661
* @param project the Project instance with the configuration for the new project
660662
* @param importUrl the URL to import the repository from
@@ -696,7 +698,9 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
696698
.withParam("repository_storage", project.getRepositoryStorage())
697699
.withParam("approvals_before_merge", project.getApprovalsBeforeMerge())
698700
.withParam("import_url", importUrl)
699-
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled());
701+
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
702+
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions())
703+
.withParam("initialize_with_readme", project.getInitializeWithReadme());
700704

701705
if (isApiVersion(ApiVersion.V3)) {
702706
boolean isPublic = (project.getPublic() != null ? project.getPublic() : project.getVisibility() == Visibility.PUBLIC);
@@ -889,12 +893,14 @@ public Project createProject(String name, Integer namespaceId, String descriptio
889893
* repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins
890894
* approvalsBeforeMerge (optional) - How many approvers should approve merge request by default
891895
* printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line
896+
* resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push
892897
*
893898
* NOTE: The following parameters specified by the GitLab API edit project are not supported:
894899
* import_url
895900
* tag_list array
896901
* avatar
897902
* ci_config_path
903+
* initialize_with_readme
898904
*
899905
* @param project the Project instance with the configuration for the new project
900906
* @return a Project instance with the newly updated project info
@@ -936,7 +942,8 @@ public Project updateProject(Project project) throws GitLabApiException {
936942
.withParam("request_access_enabled", project.getRequestAccessEnabled())
937943
.withParam("repository_storage", project.getRepositoryStorage())
938944
.withParam("approvals_before_merge", project.getApprovalsBeforeMerge())
939-
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled());
945+
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
946+
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions());
940947

941948
if (isApiVersion(ApiVersion.V3)) {
942949
formData.withParam("visibility_level", project.getVisibilityLevel());

src/main/java/org/gitlab4j/api/models/Project.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ public String toString() {
8585
private String webUrl;
8686
private Boolean wikiEnabled;
8787
private Boolean printingMergeRequestLinkEnabled;
88+
private Boolean resolveOutdatedDiffDiscussions;
8889
private ProjectStatistics statistics;
90+
private Boolean initializeWithReadme;
8991

9092
public Integer getApprovalsBeforeMerge() {
9193
return approvalsBeforeMerge;
@@ -593,6 +595,32 @@ public Project withPrintingMergeRequestLinkEnabled(Boolean printingMergeRequestL
593595
return (this);
594596
}
595597

598+
public Boolean getResolveOutdatedDiffDiscussions() {
599+
return resolveOutdatedDiffDiscussions;
600+
}
601+
602+
public void setResolveOutdatedDiffDiscussions(Boolean resolveOutdatedDiffDiscussions) {
603+
this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions;
604+
}
605+
606+
public Project withResolveOutdatedDiffDiscussions(boolean resolveOutdatedDiffDiscussions) {
607+
this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions;
608+
return (this);
609+
}
610+
611+
public Boolean getInitializeWithReadme() {
612+
return initializeWithReadme;
613+
}
614+
615+
public void setInitializeWithReadme(Boolean initializeWithReadme) {
616+
this.initializeWithReadme = initializeWithReadme;
617+
}
618+
619+
public Project withInitializeWithReadme(boolean initializeWithReadme) {
620+
this.initializeWithReadme = initializeWithReadme;
621+
return (this);
622+
}
623+
596624
public ProjectStatistics getStatistics() {
597625
return statistics;
598626
}

0 commit comments

Comments
 (0)