|
28 | 28 | import java.io.UnsupportedEncodingException;
|
29 | 29 | import java.net.URLEncoder;
|
30 | 30 | import java.util.Date;
|
| 31 | +import java.util.HashMap; |
31 | 32 | import java.util.List;
|
32 | 33 | import java.util.Map;
|
33 | 34 | import java.util.Objects;
|
@@ -1127,7 +1128,60 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
|
1127 | 1128 | .withParam("suggestion_commit_message", project.getSuggestionCommitMessage())
|
1128 | 1129 | .withParam("remove_source_branch_after_merge", project.getRemoveSourceBranchAfterMerge())
|
1129 | 1130 | .withParam("auto_devops_enabled", project.getAutoDevopsEnabled())
|
1130 |
| - .withParam("squash_option", project.getSquashOption()); |
| 1131 | + .withParam("squash_option", project.getSquashOption()) |
| 1132 | + .withParam("use_custom_template", project.getUseCustomTemplate()) |
| 1133 | + .withParam( |
| 1134 | + "external_authorization_classification_label", |
| 1135 | + project.getExternalAuthorizationClassificationLabel()) |
| 1136 | + .withParam("group_runners_enabled", project.getGroupRunnersEnabled()) |
| 1137 | + .withParam("show_default_award_emojis", project.getShowDefaultAwardEmojis()) |
| 1138 | + .withParam( |
| 1139 | + "warn_about_potentially_unwanted_characters", |
| 1140 | + project.getWarnAboutPotentiallyUnwantedCharacters()) |
| 1141 | + .withParam("mirror_trigger_builds", project.getMirrorTriggerBuilds()) |
| 1142 | + .withParam("auto_cancel_pending_pipelines", project.getAutoCancelPendingPipelines()) |
| 1143 | + .withParam("repository_object_format", project.getRepositoryObjectFormat()) |
| 1144 | + .withParam( |
| 1145 | + "only_allow_merge_if_all_status_checks_passed", |
| 1146 | + project.getOnlyAllowMergeIfAllStatusChecksPassed()) |
| 1147 | + .withParam("group_with_project_templates_id", project.getGroupWithProjectTemplatesId()) |
| 1148 | + .withParam("public_builds", project.getPublicBuilds()) |
| 1149 | + .withParam("build_timeout", project.getBuildTimeout()) |
| 1150 | + .withParam("template_name", project.getTemplateName()) |
| 1151 | + .withParam("emails_enabled", project.getEmailsEnabled()) |
| 1152 | + .withParam("mirror", project.getMirror()) |
| 1153 | + .withParam("analytics_access_level", project.getAnalyticsAccessLevel()) |
| 1154 | + .withParam("builds_access_level", project.getBuildsAccessLevel()) |
| 1155 | + .withParam("container_registry_access_level", project.getContainerRegistryAccessLevel()) |
| 1156 | + .withParam("environments_access_level", project.getEnvironmentsAccessLevel()) |
| 1157 | + .withParam("feature_flags_access_level", project.getFeatureFlagsAccessLevel()) |
| 1158 | + .withParam("forking_access_level", project.getForkingAccessLevel()) |
| 1159 | + .withParam("infrastructure_access_level", project.getInfrastructureAccessLevel()) |
| 1160 | + .withParam("issues_access_level", project.getIssuesAccessLevel()) |
| 1161 | + .withParam("merge_requests_access_level", project.getMergeRequestsAccessLevel()) |
| 1162 | + .withParam("model_experiments_access_level", project.getModelExperimentsAccessLevel()) |
| 1163 | + .withParam("model_registry_access_level", project.getModelRegistryAccessLevel()) |
| 1164 | + .withParam("monitor_access_level", project.getMonitorAccessLevel()) |
| 1165 | + .withParam("pages_access_level", project.getPagesAccessLevel()) |
| 1166 | + .withParam("releases_access_level", project.getReleasesAccessLevel()) |
| 1167 | + .withParam("repository_access_level", project.getRepositoryAccessLevel()) |
| 1168 | + .withParam("requirements_access_level", project.getRequirementsAccessLevel()) |
| 1169 | + .withParam("security_and_compliance_access_level", project.getSecurityAndComplianceAccessLevel()) |
| 1170 | + .withParam("snippets_access_level", project.getSnippetsAccessLevel()) |
| 1171 | + .withParam("wiki_access_level", project.getWikiAccessLevel()); |
| 1172 | + |
| 1173 | + if (project.getContainerExpirationPolicy() != null) { |
| 1174 | + Map<String, Object> attributes = new HashMap<>(); |
| 1175 | + attributes.put("cadence", project.getContainerExpirationPolicy().getCadence()); |
| 1176 | + attributes.put("enabled", project.getContainerExpirationPolicy().getEnabled()); |
| 1177 | + attributes.put("keep_n", project.getContainerExpirationPolicy().getKeepN()); |
| 1178 | + attributes.put("older_than", project.getContainerExpirationPolicy().getOlderThan()); |
| 1179 | + attributes.put("name_regex", project.getContainerExpirationPolicy().getNameRegex()); |
| 1180 | + attributes.put( |
| 1181 | + "name_regex_keep", project.getContainerExpirationPolicy().getNameRegexKeep()); |
| 1182 | + |
| 1183 | + formData.withParam("container_expiration_policy_attributes", attributes, false); |
| 1184 | + } |
1131 | 1185 |
|
1132 | 1186 | Namespace namespace = project.getNamespace();
|
1133 | 1187 | if (namespace != null && namespace.getId() != null) {
|
@@ -1443,7 +1497,60 @@ public Project updateProject(Project project) throws GitLabApiException {
|
1443 | 1497 | .withParam("merge_method", project.getMergeMethod())
|
1444 | 1498 | .withParam("suggestion_commit_message", project.getSuggestionCommitMessage())
|
1445 | 1499 | .withParam("remove_source_branch_after_merge", project.getRemoveSourceBranchAfterMerge())
|
1446 |
| - .withParam("squash_option", project.getSquashOption()); |
| 1500 | + .withParam("squash_option", project.getSquashOption()) |
| 1501 | + .withParam("use_custom_template", project.getUseCustomTemplate()) |
| 1502 | + .withParam( |
| 1503 | + "external_authorization_classification_label", |
| 1504 | + project.getExternalAuthorizationClassificationLabel()) |
| 1505 | + .withParam("group_runners_enabled", project.getGroupRunnersEnabled()) |
| 1506 | + .withParam("show_default_award_emojis", project.getShowDefaultAwardEmojis()) |
| 1507 | + .withParam( |
| 1508 | + "warn_about_potentially_unwanted_characters", |
| 1509 | + project.getWarnAboutPotentiallyUnwantedCharacters()) |
| 1510 | + .withParam("mirror_trigger_builds", project.getMirrorTriggerBuilds()) |
| 1511 | + .withParam("auto_cancel_pending_pipelines", project.getAutoCancelPendingPipelines()) |
| 1512 | + .withParam("repository_object_format", project.getRepositoryObjectFormat()) |
| 1513 | + .withParam( |
| 1514 | + "only_allow_merge_if_all_status_checks_passed", |
| 1515 | + project.getOnlyAllowMergeIfAllStatusChecksPassed()) |
| 1516 | + .withParam("group_with_project_templates_id", project.getGroupWithProjectTemplatesId()) |
| 1517 | + .withParam("public_builds", project.getPublicBuilds()) |
| 1518 | + .withParam("build_timeout", project.getBuildTimeout()) |
| 1519 | + .withParam("template_name", project.getTemplateName()) |
| 1520 | + .withParam("emails_enabled", project.getEmailsEnabled()) |
| 1521 | + .withParam("mirror", project.getMirror()) |
| 1522 | + .withParam("analytics_access_level", project.getAnalyticsAccessLevel()) |
| 1523 | + .withParam("builds_access_level", project.getBuildsAccessLevel()) |
| 1524 | + .withParam("container_registry_access_level", project.getContainerRegistryAccessLevel()) |
| 1525 | + .withParam("environments_access_level", project.getEnvironmentsAccessLevel()) |
| 1526 | + .withParam("feature_flags_access_level", project.getFeatureFlagsAccessLevel()) |
| 1527 | + .withParam("forking_access_level", project.getForkingAccessLevel()) |
| 1528 | + .withParam("infrastructure_access_level", project.getInfrastructureAccessLevel()) |
| 1529 | + .withParam("issues_access_level", project.getIssuesAccessLevel()) |
| 1530 | + .withParam("merge_requests_access_level", project.getMergeRequestsAccessLevel()) |
| 1531 | + .withParam("model_experiments_access_level", project.getModelExperimentsAccessLevel()) |
| 1532 | + .withParam("model_registry_access_level", project.getModelRegistryAccessLevel()) |
| 1533 | + .withParam("monitor_access_level", project.getMonitorAccessLevel()) |
| 1534 | + .withParam("pages_access_level", project.getPagesAccessLevel()) |
| 1535 | + .withParam("releases_access_level", project.getReleasesAccessLevel()) |
| 1536 | + .withParam("repository_access_level", project.getRepositoryAccessLevel()) |
| 1537 | + .withParam("requirements_access_level", project.getRequirementsAccessLevel()) |
| 1538 | + .withParam("security_and_compliance_access_level", project.getSecurityAndComplianceAccessLevel()) |
| 1539 | + .withParam("snippets_access_level", project.getSnippetsAccessLevel()) |
| 1540 | + .withParam("wiki_access_level", project.getWikiAccessLevel()); |
| 1541 | + |
| 1542 | + if (project.getContainerExpirationPolicy() != null) { |
| 1543 | + Map<String, Object> attributes = new HashMap<>(); |
| 1544 | + attributes.put("cadence", project.getContainerExpirationPolicy().getCadence()); |
| 1545 | + attributes.put("enabled", project.getContainerExpirationPolicy().getEnabled()); |
| 1546 | + attributes.put("keep_n", project.getContainerExpirationPolicy().getKeepN()); |
| 1547 | + attributes.put("older_than", project.getContainerExpirationPolicy().getOlderThan()); |
| 1548 | + attributes.put("name_regex", project.getContainerExpirationPolicy().getNameRegex()); |
| 1549 | + attributes.put( |
| 1550 | + "name_regex_keep", project.getContainerExpirationPolicy().getNameRegexKeep()); |
| 1551 | + |
| 1552 | + formData.withParam("container_expiration_policy_attributes", attributes, false); |
| 1553 | + } |
1447 | 1554 |
|
1448 | 1555 | Visibility visibility = (project.getVisibility() != null
|
1449 | 1556 | ? project.getVisibility()
|
|
0 commit comments