Skip to content

Commit fc4ed45

Browse files
committed
Added support for packages_enabled (#278).
1 parent 82ac043 commit fc4ed45

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,8 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
751751
.withParam("import_url", importUrl)
752752
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
753753
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions())
754-
.withParam("initialize_with_readme", project.getInitializeWithReadme());
754+
.withParam("initialize_with_readme", project.getInitializeWithReadme())
755+
.withParam("packages_enabled", project.getPackagesEnabled());
755756

756757
if (isApiVersion(ApiVersion.V3)) {
757758
boolean isPublic = (project.getPublic() != null ? project.getPublic() : project.getVisibility() == Visibility.PUBLIC);
@@ -994,7 +995,8 @@ public Project updateProject(Project project) throws GitLabApiException {
994995
.withParam("repository_storage", project.getRepositoryStorage())
995996
.withParam("approvals_before_merge", project.getApprovalsBeforeMerge())
996997
.withParam("printing_merge_request_link_enabled", project.getPrintingMergeRequestLinkEnabled())
997-
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions());
998+
.withParam("resolve_outdated_diff_discussions", project.getResolveOutdatedDiffDiscussions())
999+
.withParam("packages_enabled", project.getPackagesEnabled());
9981000

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

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public String toString() {
8989
private Boolean resolveOutdatedDiffDiscussions;
9090
private ProjectStatistics statistics;
9191
private Boolean initializeWithReadme;
92+
private Boolean packagesEnabled;
9293

9394
public Integer getApprovalsBeforeMerge() {
9495
return approvalsBeforeMerge;
@@ -622,6 +623,19 @@ public Project withInitializeWithReadme(boolean initializeWithReadme) {
622623
return (this);
623624
}
624625

626+
public Boolean getPackagesEnabled() {
627+
return packagesEnabled;
628+
}
629+
630+
public void setPackagesEnabled(Boolean packagesEnabled) {
631+
this.packagesEnabled = packagesEnabled;
632+
}
633+
634+
public Project withPackagesEnabled(Boolean packagesEnabled) {
635+
this.packagesEnabled = packagesEnabled;
636+
return (this);
637+
}
638+
625639
public ProjectStatistics getStatistics() {
626640
return statistics;
627641
}

0 commit comments

Comments
 (0)