From c26c845d8aeee02a82fb6f43425cd2e23f390b9a Mon Sep 17 00:00:00 2001 From: Yaris van Thiel Date: Fri, 28 Mar 2025 15:13:25 +0100 Subject: [PATCH 1/6] Added missing attributes for ProjectApi --- .../java/org/gitlab4j/api/ProjectApi.java | 86 ++- .../java/org/gitlab4j/api/models/Project.java | 547 +++++++++++++++++- .../java/org/gitlab4j/models/Constants.java | 48 ++ 3 files changed, 661 insertions(+), 20 deletions(-) diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java index 755de25d6..9804c8e7a 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -1128,7 +1128,48 @@ public Project createProject(Project project, String importUrl) throws GitLabApi .withParam("suggestion_commit_message", project.getSuggestionCommitMessage()) .withParam("remove_source_branch_after_merge", project.getRemoveSourceBranchAfterMerge()) .withParam("auto_devops_enabled", project.getAutoDevopsEnabled()) - .withParam("squash_option", project.getSquashOption()); + .withParam("squash_option", project.getSquashOption()) + .withParam("use_custom_template", project.getUseCustomTemplate()) + .withParam( + "external_authorization_classification_label", + project.getExternalAuthorizationClassificationLabel()) + .withParam("group_runners_enabled", project.getGroupRunnersEnabled()) + .withParam("show_default_award_emojis", project.getShowDefaultAwardEmojis()) + .withParam( + "warn_about_potentially_unwanted_characters", + project.getWarnAboutPotentiallyUnwantedCharacters()) + .withParam("mirror_trigger_builds", project.getMirrorTriggerBuilds()) + .withParam("auto_cancel_pending_pipelines", project.getAutoCancelPendingPipelines()) + .withParam("repository_object_format", project.getRepositoryObjectFormat()) + .withParam( + "only_allow_merge_if_all_status_checks_passed", + project.getOnlyAllowMergeIfAllStatusChecksPassed()) + .withParam("avatar", project.getAvatar()) + .withParam("group_with_project_templates_id", project.getGroupWithProjectTemplatesId()) + .withParam("public_builds", project.getPublicBuilds()) + .withParam("build_timeout", project.getBuildTimeout()) + .withParam("template_name", project.getTemplateName()) + .withParam("emails_enabled", project.getEmailsEnabled()) + .withParam("mirror", project.getMirror()) + .withParam("analytics_access_level", project.getAnalyticsAccessLevel()) + .withParam("builds_access_level", project.getBuildsAccessLevel()) + .withParam("container_registry_access_level", project.getContainerRegistryAccessLevel()) + .withParam("environments_access_level", project.getEnvironmentsAccessLevel()) + .withParam("feature_flags_access_level", project.getFeatureFlagsAccessLevel()) + .withParam("forking_access_level", project.getForkingAccessLevel()) + .withParam("infrastructure_access_level", project.getInfrastructureAccessLevel()) + .withParam("issues_access_level", project.getIssuesAccessLevel()) + .withParam("merge_requests_access_level", project.getMergeRequestsAccessLevel()) + .withParam("model_experiments_access_level", project.getModelExperimentsAccessLevel()) + .withParam("model_registry_access_level", project.getModelRegistryAccessLevel()) + .withParam("monitor_access_level", project.getMonitorAccessLevel()) + .withParam("pages_access_level", project.getPagesAccessLevel()) + .withParam("releases_access_level", project.getReleasesAccessLevel()) + .withParam("repository_access_level", project.getRepositoryAccessLevel()) + .withParam("requirements_access_level", project.getRequirementsAccessLevel()) + .withParam("security_and_compliance_access_level", project.getSecurityAndComplianceAccessLevel()) + .withParam("snippets_access_level", project.getSnippetsAccessLevel()) + .withParam("wiki_access_level", project.getWikiAccessLevel()); Namespace namespace = project.getNamespace(); if (namespace != null && namespace.getId() != null) { @@ -1490,7 +1531,48 @@ public Project updateProject(Project project) throws GitLabApiException { .withParam("merge_method", project.getMergeMethod()) .withParam("suggestion_commit_message", project.getSuggestionCommitMessage()) .withParam("remove_source_branch_after_merge", project.getRemoveSourceBranchAfterMerge()) - .withParam("squash_option", project.getSquashOption()); + .withParam("squash_option", project.getSquashOption()) + .withParam("use_custom_template", project.getUseCustomTemplate()) + .withParam( + "external_authorization_classification_label", + project.getExternalAuthorizationClassificationLabel()) + .withParam("group_runners_enabled", project.getGroupRunnersEnabled()) + .withParam("show_default_award_emojis", project.getShowDefaultAwardEmojis()) + .withParam( + "warn_about_potentially_unwanted_characters", + project.getWarnAboutPotentiallyUnwantedCharacters()) + .withParam("mirror_trigger_builds", project.getMirrorTriggerBuilds()) + .withParam("auto_cancel_pending_pipelines", project.getAutoCancelPendingPipelines()) + .withParam("repository_object_format", project.getRepositoryObjectFormat()) + .withParam( + "only_allow_merge_if_all_status_checks_passed", + project.getOnlyAllowMergeIfAllStatusChecksPassed()) + .withParam("avatar", project.getAvatar()) + .withParam("group_with_project_templates_id", project.getGroupWithProjectTemplatesId()) + .withParam("public_builds", project.getPublicBuilds()) + .withParam("build_timeout", project.getBuildTimeout()) + .withParam("template_name", project.getTemplateName()) + .withParam("emails_enabled", project.getEmailsEnabled()) + .withParam("mirror", project.getMirror()) + .withParam("analytics_access_level", project.getAnalyticsAccessLevel()) + .withParam("builds_access_level", project.getBuildsAccessLevel()) + .withParam("container_registry_access_level", project.getContainerRegistryAccessLevel()) + .withParam("environments_access_level", project.getEnvironmentsAccessLevel()) + .withParam("feature_flags_access_level", project.getFeatureFlagsAccessLevel()) + .withParam("forking_access_level", project.getForkingAccessLevel()) + .withParam("infrastructure_access_level", project.getInfrastructureAccessLevel()) + .withParam("issues_access_level", project.getIssuesAccessLevel()) + .withParam("merge_requests_access_level", project.getMergeRequestsAccessLevel()) + .withParam("model_experiments_access_level", project.getModelExperimentsAccessLevel()) + .withParam("model_registry_access_level", project.getModelRegistryAccessLevel()) + .withParam("monitor_access_level", project.getMonitorAccessLevel()) + .withParam("pages_access_level", project.getPagesAccessLevel()) + .withParam("releases_access_level", project.getReleasesAccessLevel()) + .withParam("repository_access_level", project.getRepositoryAccessLevel()) + .withParam("requirements_access_level", project.getRequirementsAccessLevel()) + .withParam("security_and_compliance_access_level", project.getSecurityAndComplianceAccessLevel()) + .withParam("snippets_access_level", project.getSnippetsAccessLevel()) + .withParam("wiki_access_level", project.getWikiAccessLevel()); if (isApiVersion(ApiVersion.V3)) { formData.withParam("visibility_level", project.getVisibilityLevel()); diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java index 89d1d52ff..b62fac9b8 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java @@ -6,8 +6,10 @@ import java.util.Map; import org.gitlab4j.api.models.ImportStatus.Status; +import org.gitlab4j.models.Constants.AutoCancelPendingPipelines; import org.gitlab4j.models.Constants.AutoDevopsDeployStrategy; import org.gitlab4j.models.Constants.BuildGitStrategy; +import org.gitlab4j.models.Constants.ProjectFeatureVisibilityAccessLevel; import org.gitlab4j.models.Constants.SquashOption; import org.gitlab4j.models.utils.JacksonJson; import org.gitlab4j.models.utils.JacksonJsonEnumHelper; @@ -122,6 +124,43 @@ public String toString() { private String mergeRequestsTemplate; private String issuesTemplate; + private Boolean useCustomTemplate; + private String externalAuthorizationClassificationLabel; + private Boolean groupRunnersEnabled; + private Boolean showDefaultAwardEmojis; + private Boolean warnAboutPotentiallyUnwantedCharacters; + private Boolean mirrorTriggerBuilds; + private AutoCancelPendingPipelines autoCancelPendingPipelines; + private String repositoryObjectFormat; + private Boolean onlyAllowMergeIfAllStatusChecksPassed; + private String avatar; + private Integer groupWithProjectTemplatesId; + private Boolean publicBuilds; + private Integer buildTimeout; + private String templateName; + private Boolean emailsEnabled; + private Boolean mirror; + + private ProjectFeatureVisibilityAccessLevel analyticsAccessLevel; + private ProjectFeatureVisibilityAccessLevel buildsAccessLevel; + private ProjectFeatureVisibilityAccessLevel containerRegistryAccessLevel; + private ProjectFeatureVisibilityAccessLevel environmentsAccessLevel; + private ProjectFeatureVisibilityAccessLevel featureFlagsAccessLevel; + private ProjectFeatureVisibilityAccessLevel forkingAccessLevel; + private ProjectFeatureVisibilityAccessLevel infrastructureAccessLevel; + private ProjectFeatureVisibilityAccessLevel issuesAccessLevel; + private ProjectFeatureVisibilityAccessLevel mergeRequestsAccessLevel; + private ProjectFeatureVisibilityAccessLevel modelExperimentsAccessLevel; + private ProjectFeatureVisibilityAccessLevel modelRegistryAccessLevel; + private ProjectFeatureVisibilityAccessLevel monitorAccessLevel; + private ProjectFeatureVisibilityAccessLevel pagesAccessLevel; + private ProjectFeatureVisibilityAccessLevel releasesAccessLevel; + private ProjectFeatureVisibilityAccessLevel repositoryAccessLevel; + private ProjectFeatureVisibilityAccessLevel requirementsAccessLevel; + private ProjectFeatureVisibilityAccessLevel securityAndComplianceAccessLevel; + private ProjectFeatureVisibilityAccessLevel snippetsAccessLevel; + private ProjectFeatureVisibilityAccessLevel wikiAccessLevel; + @JsonProperty("_links") private Map links; @@ -165,7 +204,7 @@ public void setContainerRegistryEnabled(Boolean containerRegistryEnabled) { this.containerRegistryEnabled = containerRegistryEnabled; } - public Project withContainerRegistryEnabled(boolean containerRegistryEnabled) { + public Project withContainerRegistryEnabled(Boolean containerRegistryEnabled) { this.containerRegistryEnabled = containerRegistryEnabled; return (this); } @@ -257,7 +296,7 @@ public void setIssuesEnabled(Boolean issuesEnabled) { this.issuesEnabled = issuesEnabled; } - public Project withIssuesEnabled(boolean issuesEnabled) { + public Project withIssuesEnabled(Boolean issuesEnabled) { this.issuesEnabled = issuesEnabled; return (this); } @@ -270,7 +309,7 @@ public void setJobsEnabled(Boolean jobsEnabled) { this.jobsEnabled = jobsEnabled; } - public Project withJobsEnabled(boolean jobsEnabled) { + public Project withJobsEnabled(Boolean jobsEnabled) { this.jobsEnabled = jobsEnabled; return (this); } @@ -317,7 +356,7 @@ public void setMergeRequestsEnabled(Boolean mergeRequestsEnabled) { this.mergeRequestsEnabled = mergeRequestsEnabled; } - public Project withMergeRequestsEnabled(boolean mergeRequestsEnabled) { + public Project withMergeRequestsEnabled(Boolean mergeRequestsEnabled) { this.mergeRequestsEnabled = mergeRequestsEnabled; return (this); } @@ -467,7 +506,7 @@ public void setPublicJobs(Boolean publicJobs) { this.publicJobs = publicJobs; } - public Project withPublicJobs(boolean publicJobs) { + public Project withPublicJobs(Boolean publicJobs) { this.publicJobs = publicJobs; return (this); } @@ -493,7 +532,7 @@ public void setRequestAccessEnabled(Boolean request_access_enabled) { this.requestAccessEnabled = request_access_enabled; } - public Project withRequestAccessEnabled(boolean requestAccessEnabled) { + public Project withRequestAccessEnabled(Boolean requestAccessEnabled) { this.requestAccessEnabled = requestAccessEnabled; return (this); } @@ -522,7 +561,7 @@ public void setSharedWithGroups(List sharedWithGroups) { this.sharedWithGroups = sharedWithGroups; } - public Project withSharedRunnersEnabled(boolean sharedRunnersEnabled) { + public Project withSharedRunnersEnabled(Boolean sharedRunnersEnabled) { this.sharedRunnersEnabled = sharedRunnersEnabled; return (this); } @@ -535,7 +574,7 @@ public void setSnippetsEnabled(Boolean snippetsEnabled) { this.snippetsEnabled = snippetsEnabled; } - public Project withSnippetsEnabled(boolean snippetsEnabled) { + public Project withSnippetsEnabled(Boolean snippetsEnabled) { this.snippetsEnabled = snippetsEnabled; return (this); } @@ -654,7 +693,7 @@ public void setWikiEnabled(Boolean wikiEnabled) { this.wikiEnabled = wikiEnabled; } - public Project withWikiEnabled(boolean wikiEnabled) { + public Project withWikiEnabled(Boolean wikiEnabled) { this.wikiEnabled = wikiEnabled; return (this); } @@ -680,7 +719,7 @@ public void setResolveOutdatedDiffDiscussions(Boolean resolveOutdatedDiffDiscuss this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions; } - public Project withResolveOutdatedDiffDiscussions(boolean resolveOutdatedDiffDiscussions) { + public Project withResolveOutdatedDiffDiscussions(Boolean resolveOutdatedDiffDiscussions) { this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions; return (this); } @@ -693,7 +732,7 @@ public void setInitializeWithReadme(Boolean initializeWithReadme) { this.initializeWithReadme = initializeWithReadme; } - public Project withInitializeWithReadme(boolean initializeWithReadme) { + public Project withInitializeWithReadme(Boolean initializeWithReadme) { this.initializeWithReadme = initializeWithReadme; return (this); } @@ -759,7 +798,7 @@ public void setCustomAttributes(List customAttributes) { this.customAttributes = customAttributes; } - public static final boolean isValid(Project project) { + public static boolean isValid(Project project) { return (project != null && project.getId() != null); } @@ -789,7 +828,7 @@ public void setBuildCoverageRegex(String buildCoverageRegex) { public Project withBuildCoverageRegex(String buildCoverageRegex) { this.buildCoverageRegex = buildCoverageRegex; - return this; + return (this); } public BuildGitStrategy getBuildGitStrategy() { @@ -802,7 +841,7 @@ public void setBuildGitStrategy(BuildGitStrategy buildGitStrategy) { public Project withBuildGitStrategy(BuildGitStrategy buildGitStrategy) { this.buildGitStrategy = buildGitStrategy; - return this; + return (this); } public String getReadmeUrl() { @@ -853,6 +892,11 @@ public void setCiConfigPath(String ciConfigPath) { this.ciConfigPath = ciConfigPath; } + public Project withCiConfigPath(String ciConfigPath) { + this.ciConfigPath = ciConfigPath; + return (this); + } + public Boolean getRemoveSourceBranchAfterMerge() { return removeSourceBranchAfterMerge; } @@ -863,7 +907,7 @@ public void setRemoveSourceBranchAfterMerge(Boolean removeSourceBranchAfterMerge public Project withRemoveSourceBranchAfterMerge(Boolean removeSourceBranchAfterMerge) { this.removeSourceBranchAfterMerge = removeSourceBranchAfterMerge; - return this; + return (this); } public Boolean getAutoDevopsEnabled() { @@ -874,6 +918,11 @@ public void setAutoDevopsEnabled(Boolean autoDevopsEnabled) { this.autoDevopsEnabled = autoDevopsEnabled; } + public Project withAutoDevopsEnabled(Boolean autoDevopsEnabled) { + this.autoDevopsEnabled = autoDevopsEnabled; + return (this); + } + public AutoDevopsDeployStrategy getAutoDevopsDeployStrategy() { return autoDevopsDeployStrategy; } @@ -890,6 +939,11 @@ public void setAutocloseReferencedIssues(Boolean autocloseReferencedIssues) { this.autocloseReferencedIssues = autocloseReferencedIssues; } + public Project withAutocloseReferencedIssues(Boolean autocloseReferencedIssues) { + this.autocloseReferencedIssues = autocloseReferencedIssues; + return (this); + } + public Boolean getEmailsDisabled() { return emailsDisabled; } @@ -900,7 +954,7 @@ public void setEmailsDisabled(Boolean emailsDisabled) { public Project withEmailsDisabled(Boolean emailsDisabled) { this.emailsDisabled = emailsDisabled; - return this; + return (this); } public String getSuggestionCommitMessage() { @@ -909,7 +963,7 @@ public String getSuggestionCommitMessage() { public Project withSuggestionCommitMessage(String suggestionCommitMessage) { this.suggestionCommitMessage = suggestionCommitMessage; - return this; + return (this); } public void setSuggestionCommitMessage(String suggestionCommitMessage) { @@ -926,7 +980,7 @@ public void setSquashOption(SquashOption squashOption) { public Project withSquashOption(SquashOption squashOption) { this.squashOption = squashOption; - return this; + return (this); } public String getMergeCommitTemplate() { @@ -977,6 +1031,463 @@ public void setLinks(Map links) { this.links = links; } + public Integer getBuildTimeout() { + return buildTimeout; + } + + public void setBuildTimeout(Integer buildTimeout) { + this.buildTimeout = buildTimeout; + } + + public Project withBuildTimeout(Integer buildTimeout) { + this.buildTimeout = buildTimeout; + return (this); + } + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public Project withAvatar(String avatar) { + this.avatar = avatar; + return (this); + } + + public Boolean getMirrorTriggerBuilds() { + return mirrorTriggerBuilds; + } + + public void setMirrorTriggerBuilds(Boolean mirrorTriggerBuilds) { + this.mirrorTriggerBuilds = mirrorTriggerBuilds; + } + + public Project withMirrorTriggerBuilds(Boolean mirrorTriggerBuilds) { + this.mirrorTriggerBuilds = mirrorTriggerBuilds; + return (this); + } + + public Integer getGroupWithProjectTemplatesId() { + return groupWithProjectTemplatesId; + } + + public void setGroupWithProjectTemplatesId(Integer groupWithProjectTemplatesId) { + this.groupWithProjectTemplatesId = groupWithProjectTemplatesId; + } + + public Project withGroupWithProjectTemplatesId(Integer groupWithProjectTemplatesId) { + this.groupWithProjectTemplatesId = groupWithProjectTemplatesId; + return (this); + } + + public Boolean getGroupRunnersEnabled() { + return groupRunnersEnabled; + } + + public void setGroupRunnersEnabled(Boolean groupRunnersEnabled) { + this.groupRunnersEnabled = groupRunnersEnabled; + } + + public Project withGroupRunnersEnabled(Boolean groupRunnersEnabled) { + this.groupRunnersEnabled = groupRunnersEnabled; + return (this); + } + + public Boolean getOnlyAllowMergeIfAllStatusChecksPassed() { + return onlyAllowMergeIfAllStatusChecksPassed; + } + + public void setOnlyAllowMergeIfAllStatusChecksPassed(Boolean onlyAllowMergeIfAllStatusChecksPassed) { + this.onlyAllowMergeIfAllStatusChecksPassed = onlyAllowMergeIfAllStatusChecksPassed; + } + + public Project withOnlyAllowMergeIfAllStatusChecksPassed(Boolean onlyAllowMergeIfAllStatusChecksPassed) { + this.onlyAllowMergeIfAllStatusChecksPassed = onlyAllowMergeIfAllStatusChecksPassed; + return (this); + } + + public Boolean getPublicBuilds() { + return publicBuilds; + } + + public void setPublicBuilds(Boolean publicBuilds) { + this.publicBuilds = publicBuilds; + } + + public Project withPublicBuilds(Boolean publicBuilds) { + this.publicBuilds = publicBuilds; + return (this); + } + + public String getRepositoryObjectFormat() { + return repositoryObjectFormat; + } + + public void setRepositoryObjectFormat(String repositoryObjectFormat) { + this.repositoryObjectFormat = repositoryObjectFormat; + } + + public Project withRepositoryObjectFormat(String repositoryObjectFormat) { + this.repositoryObjectFormat = repositoryObjectFormat; + return (this); + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public Project withTemplateName(String templateName) { + this.templateName = templateName; + return (this); + } + + public String getExternalAuthorizationClassificationLabel() { + return externalAuthorizationClassificationLabel; + } + + public void setExternalAuthorizationClassificationLabel(String externalAuthorizationClassificationLabel) { + this.externalAuthorizationClassificationLabel = externalAuthorizationClassificationLabel; + } + + public Project withExternalAuthorizationClassificationLabel(String externalAuthorizationClassificationLabel) { + this.externalAuthorizationClassificationLabel = externalAuthorizationClassificationLabel; + return (this); + } + + public AutoCancelPendingPipelines getAutoCancelPendingPipelines() { + return autoCancelPendingPipelines; + } + + public void setAutoCancelPendingPipelines(AutoCancelPendingPipelines autoCancelPendingPipelines) { + this.autoCancelPendingPipelines = autoCancelPendingPipelines; + } + + public Project withAutoCancelPendingPipelines(AutoCancelPendingPipelines autoCancelPendingPipelines) { + this.autoCancelPendingPipelines = autoCancelPendingPipelines; + return (this); + } + + public Boolean getUseCustomTemplate() { + return useCustomTemplate; + } + + public void setUseCustomTemplate(Boolean useCustomTemplate) { + this.useCustomTemplate = useCustomTemplate; + } + + public Project withUseCustomTemplate(Boolean useCustomTemplate) { + this.useCustomTemplate = useCustomTemplate; + return (this); + } + + public Boolean getEmailsEnabled() { + return emailsEnabled; + } + + public void setEmailsEnabled(Boolean emailsEnabled) { + this.emailsEnabled = emailsEnabled; + } + + public Project withEmailsEnabled(Boolean emailsEnabled) { + this.emailsEnabled = emailsEnabled; + return (this); + } + + public Boolean getShowDefaultAwardEmojis() { + return showDefaultAwardEmojis; + } + + public void setShowDefaultAwardEmojis(Boolean showDefaultAwardEmojis) { + this.showDefaultAwardEmojis = showDefaultAwardEmojis; + } + + public Project withShowDefaultAwardEmojis(Boolean showDefaultAwardEmojis) { + this.showDefaultAwardEmojis = showDefaultAwardEmojis; + return (this); + } + + public Boolean getWarnAboutPotentiallyUnwantedCharacters() { + return warnAboutPotentiallyUnwantedCharacters; + } + + public void setWarnAboutPotentiallyUnwantedCharacters(Boolean warnAboutPotentiallyUnwantedCharacters) { + this.warnAboutPotentiallyUnwantedCharacters = warnAboutPotentiallyUnwantedCharacters; + } + + public Project withWarnAboutPotentiallyUnwantedCharacters(Boolean warnAboutPotentiallyUnwantedCharacters) { + this.warnAboutPotentiallyUnwantedCharacters = warnAboutPotentiallyUnwantedCharacters; + return (this); + } + + public Boolean getMirror() { + return mirror; + } + + public void setMirror(Boolean mirror) { + this.mirror = mirror; + } + + public Project withMirror(Boolean mirror) { + this.mirror = mirror; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getAnalyticsAccessLevel() { + return analyticsAccessLevel; + } + + public void setAnalyticsAccessLevel(ProjectFeatureVisibilityAccessLevel analyticsAccessLevel) { + this.analyticsAccessLevel = analyticsAccessLevel; + } + + public Project withAnalyticsAccessLevel(ProjectFeatureVisibilityAccessLevel analyticsAccessLevel) { + this.analyticsAccessLevel = analyticsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getBuildsAccessLevel() { + return buildsAccessLevel; + } + + public void setBuildsAccessLevel(ProjectFeatureVisibilityAccessLevel buildsAccessLevel) { + this.buildsAccessLevel = buildsAccessLevel; + } + + public Project withBuildsAccessLevel(ProjectFeatureVisibilityAccessLevel buildsAccessLevel) { + this.buildsAccessLevel = buildsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getContainerRegistryAccessLevel() { + return containerRegistryAccessLevel; + } + + public void setContainerRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel containerRegistryAccessLevel) { + this.containerRegistryAccessLevel = containerRegistryAccessLevel; + } + + public Project withContainerRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel containerRegistryAccessLevel) { + this.containerRegistryAccessLevel = containerRegistryAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getEnvironmentsAccessLevel() { + return environmentsAccessLevel; + } + + public void setEnvironmentsAccessLevel(ProjectFeatureVisibilityAccessLevel environmentsAccessLevel) { + this.environmentsAccessLevel = environmentsAccessLevel; + } + + public Project withEnvironmentsAccessLevel(ProjectFeatureVisibilityAccessLevel environmentsAccessLevel) { + this.environmentsAccessLevel = environmentsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getFeatureFlagsAccessLevel() { + return featureFlagsAccessLevel; + } + + public void setFeatureFlagsAccessLevel(ProjectFeatureVisibilityAccessLevel featureFlagsAccessLevel) { + this.featureFlagsAccessLevel = featureFlagsAccessLevel; + } + + public Project withFeatureFlagsAccessLevel(ProjectFeatureVisibilityAccessLevel featureFlagsAccessLevel) { + this.featureFlagsAccessLevel = featureFlagsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getForkingAccessLevel() { + return forkingAccessLevel; + } + + public void setForkingAccessLevel(ProjectFeatureVisibilityAccessLevel forkingAccessLevel) { + this.forkingAccessLevel = forkingAccessLevel; + } + + public Project withForkingAccessLevel(ProjectFeatureVisibilityAccessLevel forkingAccessLevel) { + this.forkingAccessLevel = forkingAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getInfrastructureAccessLevel() { + return infrastructureAccessLevel; + } + + public void setInfrastructureAccessLevel(ProjectFeatureVisibilityAccessLevel infrastructureAccessLevel) { + this.infrastructureAccessLevel = infrastructureAccessLevel; + } + + public Project withInfrastructureAccessLevel(ProjectFeatureVisibilityAccessLevel infrastructureAccessLevel) { + this.infrastructureAccessLevel = infrastructureAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getIssuesAccessLevel() { + return issuesAccessLevel; + } + + public void setIssuesAccessLevel(ProjectFeatureVisibilityAccessLevel issuesAccessLevel) { + this.issuesAccessLevel = issuesAccessLevel; + } + + public Project withIssuesAccessLevel(ProjectFeatureVisibilityAccessLevel issuesAccessLevel) { + this.issuesAccessLevel = issuesAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getMergeRequestsAccessLevel() { + return mergeRequestsAccessLevel; + } + + public void setMergeRequestsAccessLevel(ProjectFeatureVisibilityAccessLevel mergeRequestsAccessLevel) { + this.mergeRequestsAccessLevel = mergeRequestsAccessLevel; + } + + public Project withMergeRequestsAccessLevel(ProjectFeatureVisibilityAccessLevel mergeRequestsAccessLevel) { + this.mergeRequestsAccessLevel = mergeRequestsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getModelExperimentsAccessLevel() { + return modelExperimentsAccessLevel; + } + + public void setModelExperimentsAccessLevel(ProjectFeatureVisibilityAccessLevel modelExperimentsAccessLevel) { + this.modelExperimentsAccessLevel = modelExperimentsAccessLevel; + } + + public Project withModelExperimentsAccessLevel(ProjectFeatureVisibilityAccessLevel modelExperimentsAccessLevel) { + this.modelExperimentsAccessLevel = modelExperimentsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getModelRegistryAccessLevel() { + return modelRegistryAccessLevel; + } + + public void setModelRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel modelRegistryAccessLevel) { + this.modelRegistryAccessLevel = modelRegistryAccessLevel; + } + + public Project withModelRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel modelRegistryAccessLevel) { + this.modelRegistryAccessLevel = modelRegistryAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getMonitorAccessLevel() { + return monitorAccessLevel; + } + + public void setMonitorAccessLevel(ProjectFeatureVisibilityAccessLevel monitorAccessLevel) { + this.monitorAccessLevel = monitorAccessLevel; + } + + public Project withMonitorAccessLevel(ProjectFeatureVisibilityAccessLevel monitorAccessLevel) { + this.monitorAccessLevel = monitorAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getPagesAccessLevel() { + return pagesAccessLevel; + } + + public void setPagesAccessLevel(ProjectFeatureVisibilityAccessLevel pagesAccessLevel) { + this.pagesAccessLevel = pagesAccessLevel; + } + + public Project withPagesAccessLevel(ProjectFeatureVisibilityAccessLevel pagesAccessLevel) { + this.pagesAccessLevel = pagesAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getReleasesAccessLevel() { + return releasesAccessLevel; + } + + public void setReleasesAccessLevel(ProjectFeatureVisibilityAccessLevel releasesAccessLevel) { + this.releasesAccessLevel = releasesAccessLevel; + } + + public Project withReleasesAccessLevel(ProjectFeatureVisibilityAccessLevel releasesAccessLevel) { + this.releasesAccessLevel = releasesAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getRepositoryAccessLevel() { + return repositoryAccessLevel; + } + + public void setRepositoryAccessLevel(ProjectFeatureVisibilityAccessLevel repositoryAccessLevel) { + this.repositoryAccessLevel = repositoryAccessLevel; + } + + public Project withRepositoryAccessLevel(ProjectFeatureVisibilityAccessLevel repositoryAccessLevel) { + this.repositoryAccessLevel = repositoryAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getRequirementsAccessLevel() { + return requirementsAccessLevel; + } + + public void setRequirementsAccessLevel(ProjectFeatureVisibilityAccessLevel requirementsAccessLevel) { + this.requirementsAccessLevel = requirementsAccessLevel; + } + + public Project withRequirementsAccessLevel(ProjectFeatureVisibilityAccessLevel requirementsAccessLevel) { + this.requirementsAccessLevel = requirementsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getSecurityAndComplianceAccessLevel() { + return securityAndComplianceAccessLevel; + } + + public void setSecurityAndComplianceAccessLevel( + ProjectFeatureVisibilityAccessLevel securityAndComplianceAccessLevel) { + this.securityAndComplianceAccessLevel = securityAndComplianceAccessLevel; + } + + public Project withSecurityAndComplianceAccessLevel( + ProjectFeatureVisibilityAccessLevel securityAndComplianceAccessLevel) { + this.securityAndComplianceAccessLevel = securityAndComplianceAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getSnippetsAccessLevel() { + return snippetsAccessLevel; + } + + public void setSnippetsAccessLevel(ProjectFeatureVisibilityAccessLevel snippetsAccessLevel) { + this.snippetsAccessLevel = snippetsAccessLevel; + } + + public Project withSnippetsAccessLevel(ProjectFeatureVisibilityAccessLevel snippetsAccessLevel) { + this.snippetsAccessLevel = snippetsAccessLevel; + return (this); + } + + public ProjectFeatureVisibilityAccessLevel getWikiAccessLevel() { + return wikiAccessLevel; + } + + public void setWikiAccessLevel(ProjectFeatureVisibilityAccessLevel wikiAccessLevel) { + this.wikiAccessLevel = wikiAccessLevel; + } + + public Project withWikiAccessLevel(ProjectFeatureVisibilityAccessLevel wikiAccessLevel) { + this.wikiAccessLevel = wikiAccessLevel; + return (this); + } + @JsonIgnore public String getLinkByName(String name) { if (links == null || links.isEmpty()) { diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/models/Constants.java b/gitlab4j-models/src/main/java/org/gitlab4j/models/Constants.java index 02726aecb..a0e71f2ee 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/models/Constants.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/models/Constants.java @@ -1399,4 +1399,52 @@ public String toString() { return Integer.toString(value); } } + + public enum ProjectFeatureVisibilityAccessLevel { + DISABLED, + PRIVATE, + ENABLED, + PUBLIC; + + private static final JacksonJsonEnumHelper enumHelper = + new JacksonJsonEnumHelper<>(ProjectFeatureVisibilityAccessLevel.class); + + @JsonCreator + public static ProjectFeatureVisibilityAccessLevel forValue(String value) { + return enumHelper.forValue(value); + } + + @JsonValue + public String toValue() { + return (enumHelper.toString(this)); + } + + @Override + public String toString() { + return (enumHelper.toString(this)); + } + } + + public enum AutoCancelPendingPipelines { + DISABLED, + ENABLED; + + private static final JacksonJsonEnumHelper enumHelper = + new JacksonJsonEnumHelper<>(AutoCancelPendingPipelines.class); + + @JsonCreator + public static AutoCancelPendingPipelines forValue(String value) { + return enumHelper.forValue(value); + } + + @JsonValue + public String toValue() { + return (enumHelper.toString(this)); + } + + @Override + public String toString() { + return (enumHelper.toString(this)); + } + } } From 623f9ab799625da38ca9339d5c9abd1492bc7dcf Mon Sep 17 00:00:00 2001 From: Yaris van Thiel Date: Mon, 31 Mar 2025 16:26:21 +0200 Subject: [PATCH 2/6] Remove brackets and updated project.json --- .../java/org/gitlab4j/api/models/Project.java | 156 +++++++++--------- .../org/gitlab4j/models/project.json | 37 ++++- 2 files changed, 114 insertions(+), 79 deletions(-) diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java index b62fac9b8..994f1aeb7 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java @@ -177,7 +177,7 @@ public void setApprovalsBeforeMerge(Integer approvalsBeforeMerge) { public Project withApprovalsBeforeMerge(Integer approvalsBeforeMerge) { this.approvalsBeforeMerge = approvalsBeforeMerge; - return (this); + return this; } public Boolean getArchived() { @@ -206,7 +206,7 @@ public void setContainerRegistryEnabled(Boolean containerRegistryEnabled) { public Project withContainerRegistryEnabled(Boolean containerRegistryEnabled) { this.containerRegistryEnabled = containerRegistryEnabled; - return (this); + return this; } public Date getCreatedAt() { @@ -235,7 +235,7 @@ public void setDefaultBranch(String defaultBranch) { public Project withDefaultBranch(String defaultBranch) { this.defaultBranch = defaultBranch; - return (this); + return this; } public String getDescription() { @@ -248,7 +248,7 @@ public void setDescription(String description) { public Project withDescription(String description) { this.description = description; - return (this); + return this; } public Integer getForksCount() { @@ -285,7 +285,7 @@ public void setId(Long id) { public Project withId(Long id) { this.id = id; - return (this); + return this; } public Boolean getIssuesEnabled() { @@ -298,7 +298,7 @@ public void setIssuesEnabled(Boolean issuesEnabled) { public Project withIssuesEnabled(Boolean issuesEnabled) { this.issuesEnabled = issuesEnabled; - return (this); + return this; } public Boolean getJobsEnabled() { @@ -311,7 +311,7 @@ public void setJobsEnabled(Boolean jobsEnabled) { public Project withJobsEnabled(Boolean jobsEnabled) { this.jobsEnabled = jobsEnabled; - return (this); + return this; } public Date getLastActivityAt() { @@ -332,7 +332,7 @@ public void setLfsEnabled(Boolean lfsEnabled) { public Project withLfsEnabled(Boolean lfsEnabled) { this.lfsEnabled = lfsEnabled; - return (this); + return this; } public MergeMethod getMergeMethod() { @@ -345,7 +345,7 @@ public void setMergeMethod(MergeMethod mergeMethod) { public Project withMergeMethod(MergeMethod mergeMethod) { this.mergeMethod = mergeMethod; - return (this); + return this; } public Boolean getMergeRequestsEnabled() { @@ -358,7 +358,7 @@ public void setMergeRequestsEnabled(Boolean mergeRequestsEnabled) { public Project withMergeRequestsEnabled(Boolean mergeRequestsEnabled) { this.mergeRequestsEnabled = mergeRequestsEnabled; - return (this); + return this; } public String getName() { @@ -371,7 +371,7 @@ public void setName(String name) { public Project withName(String name) { this.name = name; - return (this); + return this; } public Namespace getNamespace() { @@ -384,13 +384,13 @@ public void setNamespace(Namespace namespace) { public Project withNamespace(Namespace namespace) { this.namespace = namespace; - return (this); + return this; } public Project withNamespaceId(long namespaceId) { this.namespace = new Namespace(); this.namespace.setId(namespaceId); - return (this); + return this; } public String getNameWithNamespace() { @@ -411,7 +411,7 @@ public void setOnlyAllowMergeIfPipelineSucceeds(Boolean onlyAllowMergeIfPipeline public Project withOnlyAllowMergeIfPipelineSucceeds(Boolean onlyAllowMergeIfPipelineSucceeds) { this.onlyAllowMergeIfPipelineSucceeds = onlyAllowMergeIfPipelineSucceeds; - return (this); + return this; } public Boolean getAllowMergeOnSkippedPipeline() { @@ -424,7 +424,7 @@ public void setAllowMergeOnSkippedPipeline(Boolean allowMergeOnSkippedPipeline) public Project withAllowMergeOnSkippedPipeline(Boolean allowMergeOnSkippedPipeline) { this.allowMergeOnSkippedPipeline = allowMergeOnSkippedPipeline; - return (this); + return this; } public Boolean getOnlyAllowMergeIfAllDiscussionsAreResolved() { @@ -437,7 +437,7 @@ public void setOnlyAllowMergeIfAllDiscussionsAreResolved(Boolean onlyAllowMergeI public Project withOnlyAllowMergeIfAllDiscussionsAreResolved(Boolean onlyAllowMergeIfAllDiscussionsAreResolved) { this.onlyAllowMergeIfAllDiscussionsAreResolved = onlyAllowMergeIfAllDiscussionsAreResolved; - return (this); + return this; } public Integer getOpenIssuesCount() { @@ -466,7 +466,7 @@ public void setPath(String path) { public Project withPath(String path) { this.path = path; - return (this); + return this; } public String getPathWithNamespace() { @@ -495,7 +495,7 @@ public void setPublic(Boolean isPublic) { public Project withPublic(Boolean isPublic) { this.isPublic = isPublic; - return (this); + return this; } public Boolean getPublicJobs() { @@ -508,7 +508,7 @@ public void setPublicJobs(Boolean publicJobs) { public Project withPublicJobs(Boolean publicJobs) { this.publicJobs = publicJobs; - return (this); + return this; } public String getRepositoryStorage() { @@ -521,7 +521,7 @@ public void setRepositoryStorage(String repositoryStorage) { public Project withRepositoryStorage(String repositoryStorage) { this.repositoryStorage = repositoryStorage; - return (this); + return this; } public Boolean getRequestAccessEnabled() { @@ -534,7 +534,7 @@ public void setRequestAccessEnabled(Boolean request_access_enabled) { public Project withRequestAccessEnabled(Boolean requestAccessEnabled) { this.requestAccessEnabled = requestAccessEnabled; - return (this); + return this; } public String getRunnersToken() { @@ -563,7 +563,7 @@ public void setSharedWithGroups(List sharedWithGroups) { public Project withSharedRunnersEnabled(Boolean sharedRunnersEnabled) { this.sharedRunnersEnabled = sharedRunnersEnabled; - return (this); + return this; } public Boolean getSnippetsEnabled() { @@ -576,7 +576,7 @@ public void setSnippetsEnabled(Boolean snippetsEnabled) { public Project withSnippetsEnabled(Boolean snippetsEnabled) { this.snippetsEnabled = snippetsEnabled; - return (this); + return this; } public String getSshUrlToRepo() { @@ -617,7 +617,7 @@ public void setTagList(List tagList) { @Deprecated public Project withTagList(List tagList) { this.tagList = tagList; - return (this); + return this; } public List getTopics() { @@ -630,7 +630,7 @@ public void setTopics(List topics) { public Project withTopics(List topics) { this.topics = topics; - return (this); + return this; } public Visibility getVisibility() { @@ -643,7 +643,7 @@ public void setVisibility(Visibility visibility) { public Project withVisibility(Visibility visibility) { this.visibility = visibility; - return (this); + return this; } public Integer getVisibilityLevel() { @@ -656,7 +656,7 @@ public void setVisibilityLevel(Integer visibilityLevel) { public Project withVisibilityLevel(Integer visibilityLevel) { this.visibilityLevel = visibilityLevel; - return (this); + return this; } public Boolean getWallEnabled() { @@ -669,7 +669,7 @@ public void setWallEnabled(Boolean wallEnabled) { public Project withWallEnabled(Boolean wallEnabled) { this.wallEnabled = wallEnabled; - return (this); + return this; } public String getWebUrl() { @@ -682,7 +682,7 @@ public void setWebUrl(String webUrl) { public Project withWebUrl(String webUrl) { this.webUrl = webUrl; - return (this); + return this; } public Boolean getWikiEnabled() { @@ -695,7 +695,7 @@ public void setWikiEnabled(Boolean wikiEnabled) { public Project withWikiEnabled(Boolean wikiEnabled) { this.wikiEnabled = wikiEnabled; - return (this); + return this; } public Boolean getPrintingMergeRequestLinkEnabled() { @@ -708,7 +708,7 @@ public void setPrintingMergeRequestLinkEnabled(Boolean printingMergeRequestLinkE public Project withPrintingMergeRequestLinkEnabled(Boolean printingMergeRequestLinkEnabled) { this.printingMergeRequestLinkEnabled = printingMergeRequestLinkEnabled; - return (this); + return this; } public Boolean getResolveOutdatedDiffDiscussions() { @@ -721,7 +721,7 @@ public void setResolveOutdatedDiffDiscussions(Boolean resolveOutdatedDiffDiscuss public Project withResolveOutdatedDiffDiscussions(Boolean resolveOutdatedDiffDiscussions) { this.resolveOutdatedDiffDiscussions = resolveOutdatedDiffDiscussions; - return (this); + return this; } public Boolean getInitializeWithReadme() { @@ -734,7 +734,7 @@ public void setInitializeWithReadme(Boolean initializeWithReadme) { public Project withInitializeWithReadme(Boolean initializeWithReadme) { this.initializeWithReadme = initializeWithReadme; - return (this); + return this; } public Boolean getPackagesEnabled() { @@ -747,7 +747,7 @@ public void setPackagesEnabled(Boolean packagesEnabled) { public Project withPackagesEnabled(Boolean packagesEnabled) { this.packagesEnabled = packagesEnabled; - return (this); + return this; } public ProjectStatistics getStatistics() { @@ -828,7 +828,7 @@ public void setBuildCoverageRegex(String buildCoverageRegex) { public Project withBuildCoverageRegex(String buildCoverageRegex) { this.buildCoverageRegex = buildCoverageRegex; - return (this); + return this; } public BuildGitStrategy getBuildGitStrategy() { @@ -841,7 +841,7 @@ public void setBuildGitStrategy(BuildGitStrategy buildGitStrategy) { public Project withBuildGitStrategy(BuildGitStrategy buildGitStrategy) { this.buildGitStrategy = buildGitStrategy; - return (this); + return this; } public String getReadmeUrl() { @@ -894,7 +894,7 @@ public void setCiConfigPath(String ciConfigPath) { public Project withCiConfigPath(String ciConfigPath) { this.ciConfigPath = ciConfigPath; - return (this); + return this; } public Boolean getRemoveSourceBranchAfterMerge() { @@ -907,7 +907,7 @@ public void setRemoveSourceBranchAfterMerge(Boolean removeSourceBranchAfterMerge public Project withRemoveSourceBranchAfterMerge(Boolean removeSourceBranchAfterMerge) { this.removeSourceBranchAfterMerge = removeSourceBranchAfterMerge; - return (this); + return this; } public Boolean getAutoDevopsEnabled() { @@ -920,7 +920,7 @@ public void setAutoDevopsEnabled(Boolean autoDevopsEnabled) { public Project withAutoDevopsEnabled(Boolean autoDevopsEnabled) { this.autoDevopsEnabled = autoDevopsEnabled; - return (this); + return this; } public AutoDevopsDeployStrategy getAutoDevopsDeployStrategy() { @@ -941,7 +941,7 @@ public void setAutocloseReferencedIssues(Boolean autocloseReferencedIssues) { public Project withAutocloseReferencedIssues(Boolean autocloseReferencedIssues) { this.autocloseReferencedIssues = autocloseReferencedIssues; - return (this); + return this; } public Boolean getEmailsDisabled() { @@ -954,7 +954,7 @@ public void setEmailsDisabled(Boolean emailsDisabled) { public Project withEmailsDisabled(Boolean emailsDisabled) { this.emailsDisabled = emailsDisabled; - return (this); + return this; } public String getSuggestionCommitMessage() { @@ -963,7 +963,7 @@ public String getSuggestionCommitMessage() { public Project withSuggestionCommitMessage(String suggestionCommitMessage) { this.suggestionCommitMessage = suggestionCommitMessage; - return (this); + return this; } public void setSuggestionCommitMessage(String suggestionCommitMessage) { @@ -980,7 +980,7 @@ public void setSquashOption(SquashOption squashOption) { public Project withSquashOption(SquashOption squashOption) { this.squashOption = squashOption; - return (this); + return this; } public String getMergeCommitTemplate() { @@ -1041,7 +1041,7 @@ public void setBuildTimeout(Integer buildTimeout) { public Project withBuildTimeout(Integer buildTimeout) { this.buildTimeout = buildTimeout; - return (this); + return this; } public String getAvatar() { @@ -1054,7 +1054,7 @@ public void setAvatar(String avatar) { public Project withAvatar(String avatar) { this.avatar = avatar; - return (this); + return this; } public Boolean getMirrorTriggerBuilds() { @@ -1067,7 +1067,7 @@ public void setMirrorTriggerBuilds(Boolean mirrorTriggerBuilds) { public Project withMirrorTriggerBuilds(Boolean mirrorTriggerBuilds) { this.mirrorTriggerBuilds = mirrorTriggerBuilds; - return (this); + return this; } public Integer getGroupWithProjectTemplatesId() { @@ -1080,7 +1080,7 @@ public void setGroupWithProjectTemplatesId(Integer groupWithProjectTemplatesId) public Project withGroupWithProjectTemplatesId(Integer groupWithProjectTemplatesId) { this.groupWithProjectTemplatesId = groupWithProjectTemplatesId; - return (this); + return this; } public Boolean getGroupRunnersEnabled() { @@ -1093,7 +1093,7 @@ public void setGroupRunnersEnabled(Boolean groupRunnersEnabled) { public Project withGroupRunnersEnabled(Boolean groupRunnersEnabled) { this.groupRunnersEnabled = groupRunnersEnabled; - return (this); + return this; } public Boolean getOnlyAllowMergeIfAllStatusChecksPassed() { @@ -1106,7 +1106,7 @@ public void setOnlyAllowMergeIfAllStatusChecksPassed(Boolean onlyAllowMergeIfAll public Project withOnlyAllowMergeIfAllStatusChecksPassed(Boolean onlyAllowMergeIfAllStatusChecksPassed) { this.onlyAllowMergeIfAllStatusChecksPassed = onlyAllowMergeIfAllStatusChecksPassed; - return (this); + return this; } public Boolean getPublicBuilds() { @@ -1119,7 +1119,7 @@ public void setPublicBuilds(Boolean publicBuilds) { public Project withPublicBuilds(Boolean publicBuilds) { this.publicBuilds = publicBuilds; - return (this); + return this; } public String getRepositoryObjectFormat() { @@ -1132,7 +1132,7 @@ public void setRepositoryObjectFormat(String repositoryObjectFormat) { public Project withRepositoryObjectFormat(String repositoryObjectFormat) { this.repositoryObjectFormat = repositoryObjectFormat; - return (this); + return this; } public String getTemplateName() { @@ -1145,7 +1145,7 @@ public void setTemplateName(String templateName) { public Project withTemplateName(String templateName) { this.templateName = templateName; - return (this); + return this; } public String getExternalAuthorizationClassificationLabel() { @@ -1158,7 +1158,7 @@ public void setExternalAuthorizationClassificationLabel(String externalAuthoriza public Project withExternalAuthorizationClassificationLabel(String externalAuthorizationClassificationLabel) { this.externalAuthorizationClassificationLabel = externalAuthorizationClassificationLabel; - return (this); + return this; } public AutoCancelPendingPipelines getAutoCancelPendingPipelines() { @@ -1171,7 +1171,7 @@ public void setAutoCancelPendingPipelines(AutoCancelPendingPipelines autoCancelP public Project withAutoCancelPendingPipelines(AutoCancelPendingPipelines autoCancelPendingPipelines) { this.autoCancelPendingPipelines = autoCancelPendingPipelines; - return (this); + return this; } public Boolean getUseCustomTemplate() { @@ -1184,7 +1184,7 @@ public void setUseCustomTemplate(Boolean useCustomTemplate) { public Project withUseCustomTemplate(Boolean useCustomTemplate) { this.useCustomTemplate = useCustomTemplate; - return (this); + return this; } public Boolean getEmailsEnabled() { @@ -1197,7 +1197,7 @@ public void setEmailsEnabled(Boolean emailsEnabled) { public Project withEmailsEnabled(Boolean emailsEnabled) { this.emailsEnabled = emailsEnabled; - return (this); + return this; } public Boolean getShowDefaultAwardEmojis() { @@ -1210,7 +1210,7 @@ public void setShowDefaultAwardEmojis(Boolean showDefaultAwardEmojis) { public Project withShowDefaultAwardEmojis(Boolean showDefaultAwardEmojis) { this.showDefaultAwardEmojis = showDefaultAwardEmojis; - return (this); + return this; } public Boolean getWarnAboutPotentiallyUnwantedCharacters() { @@ -1223,7 +1223,7 @@ public void setWarnAboutPotentiallyUnwantedCharacters(Boolean warnAboutPotential public Project withWarnAboutPotentiallyUnwantedCharacters(Boolean warnAboutPotentiallyUnwantedCharacters) { this.warnAboutPotentiallyUnwantedCharacters = warnAboutPotentiallyUnwantedCharacters; - return (this); + return this; } public Boolean getMirror() { @@ -1236,7 +1236,7 @@ public void setMirror(Boolean mirror) { public Project withMirror(Boolean mirror) { this.mirror = mirror; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getAnalyticsAccessLevel() { @@ -1249,7 +1249,7 @@ public void setAnalyticsAccessLevel(ProjectFeatureVisibilityAccessLevel analytic public Project withAnalyticsAccessLevel(ProjectFeatureVisibilityAccessLevel analyticsAccessLevel) { this.analyticsAccessLevel = analyticsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getBuildsAccessLevel() { @@ -1262,7 +1262,7 @@ public void setBuildsAccessLevel(ProjectFeatureVisibilityAccessLevel buildsAcces public Project withBuildsAccessLevel(ProjectFeatureVisibilityAccessLevel buildsAccessLevel) { this.buildsAccessLevel = buildsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getContainerRegistryAccessLevel() { @@ -1275,7 +1275,7 @@ public void setContainerRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel public Project withContainerRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel containerRegistryAccessLevel) { this.containerRegistryAccessLevel = containerRegistryAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getEnvironmentsAccessLevel() { @@ -1288,7 +1288,7 @@ public void setEnvironmentsAccessLevel(ProjectFeatureVisibilityAccessLevel envir public Project withEnvironmentsAccessLevel(ProjectFeatureVisibilityAccessLevel environmentsAccessLevel) { this.environmentsAccessLevel = environmentsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getFeatureFlagsAccessLevel() { @@ -1301,7 +1301,7 @@ public void setFeatureFlagsAccessLevel(ProjectFeatureVisibilityAccessLevel featu public Project withFeatureFlagsAccessLevel(ProjectFeatureVisibilityAccessLevel featureFlagsAccessLevel) { this.featureFlagsAccessLevel = featureFlagsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getForkingAccessLevel() { @@ -1314,7 +1314,7 @@ public void setForkingAccessLevel(ProjectFeatureVisibilityAccessLevel forkingAcc public Project withForkingAccessLevel(ProjectFeatureVisibilityAccessLevel forkingAccessLevel) { this.forkingAccessLevel = forkingAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getInfrastructureAccessLevel() { @@ -1327,7 +1327,7 @@ public void setInfrastructureAccessLevel(ProjectFeatureVisibilityAccessLevel inf public Project withInfrastructureAccessLevel(ProjectFeatureVisibilityAccessLevel infrastructureAccessLevel) { this.infrastructureAccessLevel = infrastructureAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getIssuesAccessLevel() { @@ -1340,7 +1340,7 @@ public void setIssuesAccessLevel(ProjectFeatureVisibilityAccessLevel issuesAcces public Project withIssuesAccessLevel(ProjectFeatureVisibilityAccessLevel issuesAccessLevel) { this.issuesAccessLevel = issuesAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getMergeRequestsAccessLevel() { @@ -1353,7 +1353,7 @@ public void setMergeRequestsAccessLevel(ProjectFeatureVisibilityAccessLevel merg public Project withMergeRequestsAccessLevel(ProjectFeatureVisibilityAccessLevel mergeRequestsAccessLevel) { this.mergeRequestsAccessLevel = mergeRequestsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getModelExperimentsAccessLevel() { @@ -1366,7 +1366,7 @@ public void setModelExperimentsAccessLevel(ProjectFeatureVisibilityAccessLevel m public Project withModelExperimentsAccessLevel(ProjectFeatureVisibilityAccessLevel modelExperimentsAccessLevel) { this.modelExperimentsAccessLevel = modelExperimentsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getModelRegistryAccessLevel() { @@ -1379,7 +1379,7 @@ public void setModelRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel mode public Project withModelRegistryAccessLevel(ProjectFeatureVisibilityAccessLevel modelRegistryAccessLevel) { this.modelRegistryAccessLevel = modelRegistryAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getMonitorAccessLevel() { @@ -1392,7 +1392,7 @@ public void setMonitorAccessLevel(ProjectFeatureVisibilityAccessLevel monitorAcc public Project withMonitorAccessLevel(ProjectFeatureVisibilityAccessLevel monitorAccessLevel) { this.monitorAccessLevel = monitorAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getPagesAccessLevel() { @@ -1405,7 +1405,7 @@ public void setPagesAccessLevel(ProjectFeatureVisibilityAccessLevel pagesAccessL public Project withPagesAccessLevel(ProjectFeatureVisibilityAccessLevel pagesAccessLevel) { this.pagesAccessLevel = pagesAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getReleasesAccessLevel() { @@ -1418,7 +1418,7 @@ public void setReleasesAccessLevel(ProjectFeatureVisibilityAccessLevel releasesA public Project withReleasesAccessLevel(ProjectFeatureVisibilityAccessLevel releasesAccessLevel) { this.releasesAccessLevel = releasesAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getRepositoryAccessLevel() { @@ -1431,7 +1431,7 @@ public void setRepositoryAccessLevel(ProjectFeatureVisibilityAccessLevel reposit public Project withRepositoryAccessLevel(ProjectFeatureVisibilityAccessLevel repositoryAccessLevel) { this.repositoryAccessLevel = repositoryAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getRequirementsAccessLevel() { @@ -1444,7 +1444,7 @@ public void setRequirementsAccessLevel(ProjectFeatureVisibilityAccessLevel requi public Project withRequirementsAccessLevel(ProjectFeatureVisibilityAccessLevel requirementsAccessLevel) { this.requirementsAccessLevel = requirementsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getSecurityAndComplianceAccessLevel() { @@ -1459,7 +1459,7 @@ public void setSecurityAndComplianceAccessLevel( public Project withSecurityAndComplianceAccessLevel( ProjectFeatureVisibilityAccessLevel securityAndComplianceAccessLevel) { this.securityAndComplianceAccessLevel = securityAndComplianceAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getSnippetsAccessLevel() { @@ -1472,7 +1472,7 @@ public void setSnippetsAccessLevel(ProjectFeatureVisibilityAccessLevel snippetsA public Project withSnippetsAccessLevel(ProjectFeatureVisibilityAccessLevel snippetsAccessLevel) { this.snippetsAccessLevel = snippetsAccessLevel; - return (this); + return this; } public ProjectFeatureVisibilityAccessLevel getWikiAccessLevel() { @@ -1485,7 +1485,7 @@ public void setWikiAccessLevel(ProjectFeatureVisibilityAccessLevel wikiAccessLev public Project withWikiAccessLevel(ProjectFeatureVisibilityAccessLevel wikiAccessLevel) { this.wikiAccessLevel = wikiAccessLevel; - return (this); + return this; } @JsonIgnore diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json index 982b3feec..6d899f78e 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json @@ -126,5 +126,40 @@ "job_artifacts_size" : 0, "packages_size" : 0 }, - "custom_attributes" : [ ] + "custom_attributes" : [ ], + "use_custom_template" : false, + "external_authorization_classification_label" : "label", + "group_runners_enabled" : true, + "show_default_award_emojis" : false, + "warn_about_potentially_unwanted_characters" : true, + "mirror_trigger_builds" : false, + "auto_cancel_pending_pipelines" : "enabled", + "repository_object_format" : "sha1", + "only_allow_merge_if_all_status_checks_passed" : false, + "avatar" : null, + "group_with_project_templates_id" : null, + "public_builds" : null, + "build_timeout" : 3600, + "template_name" : "template", + "emails_enabled" : true, + "mirror" : false, + "analytics_access_level" : "enabled", + "builds_access_level" : "enabled", + "container_registry_access_level" : "enabled", + "environments_access_level" : "enabled", + "feature_flags_access_level" : "enabled", + "forking_access_level" : "enabled", + "infrastructure_access_level" : "enabled", + "issues_access_level" : "enabled", + "merge_requests_access_level" : "disabled", + "model_experiments_access_level" : "enabled", + "model_registry_access_level" : "enabled", + "monitor_access_level" : "enabled", + "pages_access_level" : "private", + "releases_access_level" : "enabled", + "repository_access_level" : "enabled", + "requirements_access_level" : "enabled", + "security_and_compliance_access_level" : "private", + "snippets_access_level" : "enabled", + "wiki_access_level" : "enabled" } From 23bad2d0a70d630024be5511a5fe624186473709 Mon Sep 17 00:00:00 2001 From: Yaris van Thiel Date: Tue, 1 Apr 2025 08:11:17 +0200 Subject: [PATCH 3/6] Don't use null, and remove avatar --- .../src/main/java/org/gitlab4j/api/ProjectApi.java | 2 -- .../main/java/org/gitlab4j/api/models/Project.java | 14 -------------- .../resources/org/gitlab4j/models/project.json | 5 ++--- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java index 9804c8e7a..b4e79782b 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -1144,7 +1144,6 @@ public Project createProject(Project project, String importUrl) throws GitLabApi .withParam( "only_allow_merge_if_all_status_checks_passed", project.getOnlyAllowMergeIfAllStatusChecksPassed()) - .withParam("avatar", project.getAvatar()) .withParam("group_with_project_templates_id", project.getGroupWithProjectTemplatesId()) .withParam("public_builds", project.getPublicBuilds()) .withParam("build_timeout", project.getBuildTimeout()) @@ -1547,7 +1546,6 @@ public Project updateProject(Project project) throws GitLabApiException { .withParam( "only_allow_merge_if_all_status_checks_passed", project.getOnlyAllowMergeIfAllStatusChecksPassed()) - .withParam("avatar", project.getAvatar()) .withParam("group_with_project_templates_id", project.getGroupWithProjectTemplatesId()) .withParam("public_builds", project.getPublicBuilds()) .withParam("build_timeout", project.getBuildTimeout()) diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java index 994f1aeb7..75bb7b549 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java @@ -133,7 +133,6 @@ public String toString() { private AutoCancelPendingPipelines autoCancelPendingPipelines; private String repositoryObjectFormat; private Boolean onlyAllowMergeIfAllStatusChecksPassed; - private String avatar; private Integer groupWithProjectTemplatesId; private Boolean publicBuilds; private Integer buildTimeout; @@ -1044,19 +1043,6 @@ public Project withBuildTimeout(Integer buildTimeout) { return this; } - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public Project withAvatar(String avatar) { - this.avatar = avatar; - return this; - } - public Boolean getMirrorTriggerBuilds() { return mirrorTriggerBuilds; } diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json index 6d899f78e..aefee0544 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json @@ -136,9 +136,8 @@ "auto_cancel_pending_pipelines" : "enabled", "repository_object_format" : "sha1", "only_allow_merge_if_all_status_checks_passed" : false, - "avatar" : null, - "group_with_project_templates_id" : null, - "public_builds" : null, + "group_with_project_templates_id" : 1, + "public_builds" : true, "build_timeout" : 3600, "template_name" : "template", "emails_enabled" : true, From 1220a9cf833ca490b094c24e7497933bbd3fc459 Mon Sep 17 00:00:00 2001 From: Yaris van Thiel Date: Fri, 4 Apr 2025 11:45:38 +0200 Subject: [PATCH 4/6] Added more missing properties --- .../api/models/ContainerExpirationPolicy.java | 78 ++++++ .../java/org/gitlab4j/api/models/Project.java | 225 ++++++++++++++++++ .../org/gitlab4j/models/project.json | 36 ++- 3 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java new file mode 100644 index 000000000..a69c51a0a --- /dev/null +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java @@ -0,0 +1,78 @@ +package org.gitlab4j.api.models; + +import java.io.Serializable; + +import org.gitlab4j.models.utils.JacksonJson; + +public class ContainerExpirationPolicy implements Serializable { + private static final long serialVersionUID = 1L; + + private String cadence; + private Boolean enabled; + private Integer keepN; + private String olderThan; + private String nameRegex; + private String nameRegexKeep; + private String nextRunAt; + + public String getCadence() { + return cadence; + } + + public void setCadence(String cadence) { + this.cadence = cadence; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getKeepN() { + return keepN; + } + + public void setKeepN(Integer keepN) { + this.keepN = keepN; + } + + public String getOlderThan() { + return olderThan; + } + + public void setOlderThan(String olderThan) { + this.olderThan = olderThan; + } + + public String getNameRegex() { + return nameRegex; + } + + public void setNameRegex(String nameRegex) { + this.nameRegex = nameRegex; + } + + public String getNameRegexKeep() { + return nameRegexKeep; + } + + public void setNameRegexKeep(String nameRegexKeep) { + this.nameRegexKeep = nameRegexKeep; + } + + public String getNextRunAt() { + return nextRunAt; + } + + public void setNextRunAt(String nextRunAt) { + this.nextRunAt = nextRunAt; + } + + @Override + public String toString() { + return (JacksonJson.toJsonString(this)); + } +} diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java index 75bb7b549..9902734e3 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java @@ -139,6 +139,31 @@ public String toString() { private String templateName; private Boolean emailsEnabled; private Boolean mirror; + private Date updatedAt; + private String descriptionHtml; + private String containerRegistryImagePrefix; + private ContainerExpirationPolicy containerExpirationPolicy; + private Boolean serviceDeskEnabled; + private String importUrl; + private String importType; + private String importError; + private Boolean ciForwardDeploymentRollbackAllowed; + private Boolean ciAllowForkPipelinesToRunInParentProject; + private List ciIdTokenSubClaimComponents; + private Boolean ciJobTokenScopeEnabled; + private Boolean ciSeparatedCaches; + private String ciRestrictPipelineCancellationRole; + private String ciPipelineVariablesMinimumOverrideRole; + private Boolean ciPushRepositoryForJobTokenAllowed; + private Boolean allowPipelineTriggerApproveDeployment; + private Boolean restrictUserDefinedVariables; + private Boolean enforceAuthChecksOnUploads; + private Boolean keepLatestArtifact; + private Integer runnerTokenExpirationInterval; + private Boolean requirementsEnabled; + private Boolean securityAndComplianceEnabled; + private Boolean secretPushProtectionEnabled; + private List complianceFrameworks; private ProjectFeatureVisibilityAccessLevel analyticsAccessLevel; private ProjectFeatureVisibilityAccessLevel buildsAccessLevel; @@ -1225,6 +1250,206 @@ public Project withMirror(Boolean mirror) { return this; } + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public String getDescriptionHtml() { + return descriptionHtml; + } + + public void setDescriptionHtml(String descriptionHtml) { + this.descriptionHtml = descriptionHtml; + } + + public String getContainerRegistryImagePrefix() { + return containerRegistryImagePrefix; + } + + public void setContainerRegistryImagePrefix(String containerRegistryImagePrefix) { + this.containerRegistryImagePrefix = containerRegistryImagePrefix; + } + + public ContainerExpirationPolicy getContainerExpirationPolicy() { + return containerExpirationPolicy; + } + + public void setContainerExpirationPolicy(ContainerExpirationPolicy containerExpirationPolicy) { + this.containerExpirationPolicy = containerExpirationPolicy; + } + + public Boolean getServiceDeskEnabled() { + return serviceDeskEnabled; + } + + public void setServiceDeskEnabled(Boolean serviceDeskEnabled) { + this.serviceDeskEnabled = serviceDeskEnabled; + } + + public String getImportUrl() { + return importUrl; + } + + public void setImportUrl(String importUrl) { + this.importUrl = importUrl; + } + + public String getImportType() { + return importType; + } + + public void setImportType(String importType) { + this.importType = importType; + } + + public String getImportError() { + return importError; + } + + public void setImportError(String importError) { + this.importError = importError; + } + + public Boolean getCiForwardDeploymentRollbackAllowed() { + return ciForwardDeploymentRollbackAllowed; + } + + public void setCiForwardDeploymentRollbackAllowed(Boolean ciForwardDeploymentRollbackAllowed) { + this.ciForwardDeploymentRollbackAllowed = ciForwardDeploymentRollbackAllowed; + } + + public Boolean getCiAllowForkPipelinesToRunInParentProject() { + return ciAllowForkPipelinesToRunInParentProject; + } + + public void setCiAllowForkPipelinesToRunInParentProject(Boolean ciAllowForkPipelinesToRunInParentProject) { + this.ciAllowForkPipelinesToRunInParentProject = ciAllowForkPipelinesToRunInParentProject; + } + + public List getCiIdTokenSubClaimComponents() { + return ciIdTokenSubClaimComponents; + } + + public void setCiIdTokenSubClaimComponents(List ciIdTokenSubClaimComponents) { + this.ciIdTokenSubClaimComponents = ciIdTokenSubClaimComponents; + } + + public Boolean getCiJobTokenScopeEnabled() { + return ciJobTokenScopeEnabled; + } + + public void setCiJobTokenScopeEnabled(Boolean ciJobTokenScopeEnabled) { + this.ciJobTokenScopeEnabled = ciJobTokenScopeEnabled; + } + + public Boolean getCiSeparatedCaches() { + return ciSeparatedCaches; + } + + public void setCiSeparatedCaches(Boolean ciSeparatedCaches) { + this.ciSeparatedCaches = ciSeparatedCaches; + } + + public String getCiRestrictPipelineCancellationRole() { + return ciRestrictPipelineCancellationRole; + } + + public void setCiRestrictPipelineCancellationRole(String ciRestrictPipelineCancellationRole) { + this.ciRestrictPipelineCancellationRole = ciRestrictPipelineCancellationRole; + } + + public String getCiPipelineVariablesMinimumOverrideRole() { + return ciPipelineVariablesMinimumOverrideRole; + } + + public void setCiPipelineVariablesMinimumOverrideRole(String ciPipelineVariablesMinimumOverrideRole) { + this.ciPipelineVariablesMinimumOverrideRole = ciPipelineVariablesMinimumOverrideRole; + } + + public Boolean getCiPushRepositoryForJobTokenAllowed() { + return ciPushRepositoryForJobTokenAllowed; + } + + public void setCiPushRepositoryForJobTokenAllowed(Boolean ciPushRepositoryForJobTokenAllowed) { + this.ciPushRepositoryForJobTokenAllowed = ciPushRepositoryForJobTokenAllowed; + } + + public Boolean getAllowPipelineTriggerApproveDeployment() { + return allowPipelineTriggerApproveDeployment; + } + + public void setAllowPipelineTriggerApproveDeployment(Boolean allowPipelineTriggerApproveDeployment) { + this.allowPipelineTriggerApproveDeployment = allowPipelineTriggerApproveDeployment; + } + + public Boolean getRestrictUserDefinedVariables() { + return restrictUserDefinedVariables; + } + + public void setRestrictUserDefinedVariables(Boolean restrictUserDefinedVariables) { + this.restrictUserDefinedVariables = restrictUserDefinedVariables; + } + + public Boolean getEnforceAuthChecksOnUploads() { + return enforceAuthChecksOnUploads; + } + + public void setEnforceAuthChecksOnUploads(Boolean enforceAuthChecksOnUploads) { + this.enforceAuthChecksOnUploads = enforceAuthChecksOnUploads; + } + + public Boolean getKeepLatestArtifact() { + return keepLatestArtifact; + } + + public void setKeepLatestArtifact(Boolean keepLatestArtifact) { + this.keepLatestArtifact = keepLatestArtifact; + } + + public Integer getRunnerTokenExpirationInterval() { + return runnerTokenExpirationInterval; + } + + public void setRunnerTokenExpirationInterval(Integer runnerTokenExpirationInterval) { + this.runnerTokenExpirationInterval = runnerTokenExpirationInterval; + } + + public Boolean getRequirementsEnabled() { + return requirementsEnabled; + } + + public void setRequirementsEnabled(Boolean requirementsEnabled) { + this.requirementsEnabled = requirementsEnabled; + } + + public Boolean getSecurityAndComplianceEnabled() { + return securityAndComplianceEnabled; + } + + public void setSecurityAndComplianceEnabled(Boolean securityAndComplianceEnabled) { + this.securityAndComplianceEnabled = securityAndComplianceEnabled; + } + + public Boolean getSecretPushProtectionEnabled() { + return secretPushProtectionEnabled; + } + + public void setSecretPushProtectionEnabled(Boolean secretPushProtectionEnabled) { + this.secretPushProtectionEnabled = secretPushProtectionEnabled; + } + + public List getComplianceFrameworks() { + return complianceFrameworks; + } + + public void setComplianceFrameworks(List complianceFrameworks) { + this.complianceFrameworks = complianceFrameworks; + } + public ProjectFeatureVisibilityAccessLevel getAnalyticsAccessLevel() { return analyticsAccessLevel; } diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json index aefee0544..773526c3b 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json @@ -1,14 +1,16 @@ { "id" : 3, "description" : "Some description", + "description_html" : "

Some description

", "name" : "Diaspora Project Site", "name_with_namespace" : "Diaspora / Diaspora Project Site", "path" : "diaspora-project-site", "path_with_namespace" : "diaspora/diaspora-project-site", "created_at" : "2013-09-30T13:46:02Z", + "updated_at" : "2013-09-30T13:46:02Z", "default_branch" : "master", "tag_list" : [ "example", "disapora project" ], - "topics" : [ ], + "topics" : [ "example", "disapora project" ], "ssh_url_to_repo" : "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo" : "http://example.com/diaspora/diaspora-project-site.git", "web_url" : "http://example.com/diaspora/diaspora-project-site", @@ -27,6 +29,7 @@ "avatar_url" : "http://localhost:3000/uploads/group/avatar/3/foo.jpg", "web_url" : "http://localhost:3000/groups/diaspora" }, + "container_registry_image_prefix" : "registry.gitlab.example.com/diaspora/diaspora-client", "_links" : { "self" : "https://example.com/api/v4/projects/3", "issues" : "https://example.com/api/v4/projects/3/issues", @@ -51,17 +54,31 @@ "created_at" : "2013-09-30T13:46:02Z" }, "resolve_outdated_diff_discussions" : false, + "container_expiration_policy" : { + "cadence" : "1month", + "enabled" : true, + "keep_n" : 1, + "older_than" : "14d", + "name_regex" : "", + "name_regex_keep" : ".*-main", + "next_run_at" : "2022-06-25T17:11:26.865Z" + }, "issues_enabled" : true, "merge_requests_enabled" : true, "wiki_enabled" : true, "jobs_enabled" : true, "snippets_enabled" : false, "container_registry_enabled" : false, + "service_desk_enabled" : true, "can_create_merge_request_in" : true, "emails_disabled" : false, "shared_runners_enabled" : true, "lfs_enabled" : true, "creator_id" : 3, + "import_url" : "https://mirror-source/group/project.git", + "import_type" : "github", + "import_status" : "none", + "import_error" : "Some error", "open_issues_count" : 1, "ci_default_git_depth" : 50, "ci_forward_deployment_enabled" : true, @@ -69,6 +86,14 @@ "runners_token" : "b8bc4a7a29eb76ea83cf79e4908c2b", "auto_devops_enabled" : true, "auto_devops_deploy_strategy" : "continuous", + "ci_forward_deployment_rollback_allowed" : true, + "ci_allow_fork_pipelines_to_run_in_parent_project" : true, + "ci_id_token_sub_claim_components" : [ "project_path", "ref_type", "ref" ], + "ci_job_token_scope_enabled" : false, + "ci_separated_caches" : true, + "ci_restrict_pipeline_cancellation_role" : "developer", + "ci_pipeline_variables_minimum_override_role" : "maintainer", + "ci_push_repository_for_job_token_allowed" : false, "ci_config_path" : "", "public_jobs" : true, "shared_with_groups" : [ { @@ -86,12 +111,15 @@ } ], "only_allow_merge_if_pipeline_succeeds" : false, "allow_merge_on_skipped_pipeline" : true, + "allow_pipeline_trigger_approve_deployment" : false, + "restrict_user_defined_variables" : false, "request_access_enabled" : false, "only_allow_merge_if_all_discussions_are_resolved" : false, "remove_source_branch_after_merge" : false, "printing_merge_request_link_enabled" : true, "merge_method" : "merge", "squash_option" : "default_off", + "enforce_auth_checks_on_uploads" : true, "suggestion_commit_message": "Apply suggestions", "merge_commit_template": "Merge branch '%{source_branch}' into '%{target_branch}'", "squash_commit_template": "Commit %{title}", @@ -99,6 +127,12 @@ "merge_requests_template": "", "issues_template": "", "autoclose_referenced_issues" : true, + "keep_latest_artifact" : true, + "runner_token_expiration_interval" : 7200, + "requirements_enabled" : false, + "security_and_compliance_enabled" : false, + "secret_push_protection_enabled" : false, + "compliance_frameworks" : [], "permissions" : { "project_access" : { "access_level" : 10, From ce735e4d27b32ff350f55a53cad28a747b9f39c4 Mon Sep 17 00:00:00 2001 From: Yaris van Thiel Date: Fri, 4 Apr 2025 13:08:59 +0200 Subject: [PATCH 5/6] Update container expiration policy --- .../java/org/gitlab4j/api/ProjectApi.java | 22 ++++++++++ .../api/models/ContainerExpirationPolicy.java | 41 +++++++++++++++++++ .../ContainerExpirationPolicyAttributes.java | 33 +++++++++++++++ .../java/org/gitlab4j/api/models/Project.java | 5 +++ .../org/gitlab4j/models/project.json | 2 +- 5 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java index b4e79782b..3bea995c3 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -47,6 +47,7 @@ import org.gitlab4j.api.models.ApprovalRuleParams; import org.gitlab4j.api.models.AuditEvent; import org.gitlab4j.api.models.Badge; +import org.gitlab4j.api.models.ContainerExpirationPolicyAttributes; import org.gitlab4j.api.models.CustomAttribute; import org.gitlab4j.api.models.Event; import org.gitlab4j.api.models.FileUpload; @@ -4727,4 +4728,25 @@ public List listProjectIterations(Object projectIdOrPath, IterationFi get(Response.Status.OK, queryParams, "projects", getProjectIdOrPath(projectIdOrPath), "iterations"); return (response.readEntity(new GenericType>() {})); } + + /** + * Uploads and sets the project container expiration policy for the specified project. + * + *
GitLab Endpoint: PUT /projects/:id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required + * @param containerExpirationPolicyAttributes the ContainerExpirationPolicyAttributes instance + * @return the updated Project instance + * @throws GitLabApiException if any exception occurs + */ + public Project setProjectContainerExpirationPolicy( + Object projectIdOrPath, ContainerExpirationPolicyAttributes containerExpirationPolicyAttributes) + throws GitLabApiException { + Response response = put( + Response.Status.OK, + containerExpirationPolicyAttributes.toString(), + "projects", + getProjectIdOrPath(projectIdOrPath)); + return (response.readEntity(Project.class)); + } } diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java index a69c51a0a..c7f0a48d6 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java @@ -4,15 +4,26 @@ import org.gitlab4j.models.utils.JacksonJson; +import com.fasterxml.jackson.annotation.JsonProperty; + public class ContainerExpirationPolicy implements Serializable { private static final long serialVersionUID = 1L; private String cadence; private Boolean enabled; + + @JsonProperty("keep_n") private Integer keepN; + + @JsonProperty("older_than") private String olderThan; + + @JsonProperty("name_regex") private String nameRegex; + + @JsonProperty("name_regex_keep") private String nameRegexKeep; + private String nextRunAt; public String getCadence() { @@ -23,6 +34,11 @@ public void setCadence(String cadence) { this.cadence = cadence; } + public ContainerExpirationPolicy withCadence(String cadence) { + this.cadence = cadence; + return this; + } + public Boolean getEnabled() { return enabled; } @@ -31,6 +47,11 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } + public ContainerExpirationPolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + public Integer getKeepN() { return keepN; } @@ -39,6 +60,11 @@ public void setKeepN(Integer keepN) { this.keepN = keepN; } + public ContainerExpirationPolicy withKeepN(Integer keepN) { + this.keepN = keepN; + return this; + } + public String getOlderThan() { return olderThan; } @@ -47,6 +73,11 @@ public void setOlderThan(String olderThan) { this.olderThan = olderThan; } + public ContainerExpirationPolicy withOlderThan(String olderThan) { + this.olderThan = olderThan; + return this; + } + public String getNameRegex() { return nameRegex; } @@ -55,6 +86,11 @@ public void setNameRegex(String nameRegex) { this.nameRegex = nameRegex; } + public ContainerExpirationPolicy withNameRegex(String nameRegex) { + this.nameRegex = nameRegex; + return this; + } + public String getNameRegexKeep() { return nameRegexKeep; } @@ -63,6 +99,11 @@ public void setNameRegexKeep(String nameRegexKeep) { this.nameRegexKeep = nameRegexKeep; } + public ContainerExpirationPolicy withNameRegexKeep(String nameRegexKeep) { + this.nameRegexKeep = nameRegexKeep; + return this; + } + public String getNextRunAt() { return nextRunAt; } diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java new file mode 100644 index 000000000..64135d9b1 --- /dev/null +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java @@ -0,0 +1,33 @@ +package org.gitlab4j.api.models; + +import java.io.Serializable; + +import org.gitlab4j.models.utils.JacksonJson; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ContainerExpirationPolicyAttributes implements Serializable { + private static final long serialVersionUID = 1L; + + @JsonProperty("container_expiration_policy_attributes") + private ContainerExpirationPolicy containerExpirationPolicyAttributes; + + public ContainerExpirationPolicy getContainerExpirationPolicyAttributes() { + return containerExpirationPolicyAttributes; + } + + public void setContainerExpirationPolicyAttributes(ContainerExpirationPolicy containerExpirationPolicyAttributes) { + this.containerExpirationPolicyAttributes = containerExpirationPolicyAttributes; + } + + public ContainerExpirationPolicyAttributes withContainerExpirationPolicyAttributes( + ContainerExpirationPolicy containerExpirationPolicyAttributes) { + this.containerExpirationPolicyAttributes = containerExpirationPolicyAttributes; + return this; + } + + @Override + public String toString() { + return (JacksonJson.toJsonString(this)); + } +} diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java index 9902734e3..82e3e475d 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Project.java @@ -1282,6 +1282,11 @@ public void setContainerExpirationPolicy(ContainerExpirationPolicy containerExpi this.containerExpirationPolicy = containerExpirationPolicy; } + public Project withContainerExpirationPolicy(ContainerExpirationPolicy containerExpirationPolicy) { + this.containerExpirationPolicy = containerExpirationPolicy; + return this; + } + public Boolean getServiceDeskEnabled() { return serviceDeskEnabled; } diff --git a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json index 773526c3b..bfbf979b7 100644 --- a/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json +++ b/gitlab4j-models/src/test/resources/org/gitlab4j/models/project.json @@ -59,7 +59,7 @@ "enabled" : true, "keep_n" : 1, "older_than" : "14d", - "name_regex" : "", + "name_regex" : ".*-development", "name_regex_keep" : ".*-main", "next_run_at" : "2022-06-25T17:11:26.865Z" }, From e73c2b29c98586e71a16acc662ec65461523a94f Mon Sep 17 00:00:00 2001 From: Yaris van Thiel Date: Wed, 9 Apr 2025 16:56:10 +0200 Subject: [PATCH 6/6] Simplified project containerExpirationPolicy --- .../java/org/gitlab4j/api/ProjectApi.java | 49 ++++++++++--------- .../api/models/ContainerExpirationPolicy.java | 10 ---- .../ContainerExpirationPolicyAttributes.java | 33 ------------- 3 files changed, 27 insertions(+), 65 deletions(-) delete mode 100644 gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java index 3bea995c3..1980fb7ce 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -28,6 +28,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -47,7 +48,6 @@ import org.gitlab4j.api.models.ApprovalRuleParams; import org.gitlab4j.api.models.AuditEvent; import org.gitlab4j.api.models.Badge; -import org.gitlab4j.api.models.ContainerExpirationPolicyAttributes; import org.gitlab4j.api.models.CustomAttribute; import org.gitlab4j.api.models.Event; import org.gitlab4j.api.models.FileUpload; @@ -1171,6 +1171,19 @@ public Project createProject(Project project, String importUrl) throws GitLabApi .withParam("snippets_access_level", project.getSnippetsAccessLevel()) .withParam("wiki_access_level", project.getWikiAccessLevel()); + if (project.getContainerExpirationPolicy() != null) { + Map attributes = new HashMap<>(); + attributes.put("cadence", project.getContainerExpirationPolicy().getCadence()); + attributes.put("enabled", project.getContainerExpirationPolicy().getEnabled()); + attributes.put("keep_n", project.getContainerExpirationPolicy().getKeepN()); + attributes.put("older_than", project.getContainerExpirationPolicy().getOlderThan()); + attributes.put("name_regex", project.getContainerExpirationPolicy().getNameRegex()); + attributes.put( + "name_regex_keep", project.getContainerExpirationPolicy().getNameRegexKeep()); + + formData.withParam("container_expiration_policy_attributes", attributes, false); + } + Namespace namespace = project.getNamespace(); if (namespace != null && namespace.getId() != null) { formData.withParam("namespace_id", namespace.getId()); @@ -1573,6 +1586,19 @@ public Project updateProject(Project project) throws GitLabApiException { .withParam("snippets_access_level", project.getSnippetsAccessLevel()) .withParam("wiki_access_level", project.getWikiAccessLevel()); + if (project.getContainerExpirationPolicy() != null) { + Map attributes = new HashMap<>(); + attributes.put("cadence", project.getContainerExpirationPolicy().getCadence()); + attributes.put("enabled", project.getContainerExpirationPolicy().getEnabled()); + attributes.put("keep_n", project.getContainerExpirationPolicy().getKeepN()); + attributes.put("older_than", project.getContainerExpirationPolicy().getOlderThan()); + attributes.put("name_regex", project.getContainerExpirationPolicy().getNameRegex()); + attributes.put( + "name_regex_keep", project.getContainerExpirationPolicy().getNameRegexKeep()); + + formData.withParam("container_expiration_policy_attributes", attributes, false); + } + if (isApiVersion(ApiVersion.V3)) { formData.withParam("visibility_level", project.getVisibilityLevel()); boolean isPublic = @@ -4728,25 +4754,4 @@ public List listProjectIterations(Object projectIdOrPath, IterationFi get(Response.Status.OK, queryParams, "projects", getProjectIdOrPath(projectIdOrPath), "iterations"); return (response.readEntity(new GenericType>() {})); } - - /** - * Uploads and sets the project container expiration policy for the specified project. - * - *
GitLab Endpoint: PUT /projects/:id
- * - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required - * @param containerExpirationPolicyAttributes the ContainerExpirationPolicyAttributes instance - * @return the updated Project instance - * @throws GitLabApiException if any exception occurs - */ - public Project setProjectContainerExpirationPolicy( - Object projectIdOrPath, ContainerExpirationPolicyAttributes containerExpirationPolicyAttributes) - throws GitLabApiException { - Response response = put( - Response.Status.OK, - containerExpirationPolicyAttributes.toString(), - "projects", - getProjectIdOrPath(projectIdOrPath)); - return (response.readEntity(Project.class)); - } } diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java index c7f0a48d6..181916c67 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicy.java @@ -4,24 +4,14 @@ import org.gitlab4j.models.utils.JacksonJson; -import com.fasterxml.jackson.annotation.JsonProperty; - public class ContainerExpirationPolicy implements Serializable { private static final long serialVersionUID = 1L; private String cadence; private Boolean enabled; - - @JsonProperty("keep_n") private Integer keepN; - - @JsonProperty("older_than") private String olderThan; - - @JsonProperty("name_regex") private String nameRegex; - - @JsonProperty("name_regex_keep") private String nameRegexKeep; private String nextRunAt; diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java deleted file mode 100644 index 64135d9b1..000000000 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/ContainerExpirationPolicyAttributes.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.gitlab4j.api.models; - -import java.io.Serializable; - -import org.gitlab4j.models.utils.JacksonJson; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class ContainerExpirationPolicyAttributes implements Serializable { - private static final long serialVersionUID = 1L; - - @JsonProperty("container_expiration_policy_attributes") - private ContainerExpirationPolicy containerExpirationPolicyAttributes; - - public ContainerExpirationPolicy getContainerExpirationPolicyAttributes() { - return containerExpirationPolicyAttributes; - } - - public void setContainerExpirationPolicyAttributes(ContainerExpirationPolicy containerExpirationPolicyAttributes) { - this.containerExpirationPolicyAttributes = containerExpirationPolicyAttributes; - } - - public ContainerExpirationPolicyAttributes withContainerExpirationPolicyAttributes( - ContainerExpirationPolicy containerExpirationPolicyAttributes) { - this.containerExpirationPolicyAttributes = containerExpirationPolicyAttributes; - return this; - } - - @Override - public String toString() { - return (JacksonJson.toJsonString(this)); - } -}