@@ -567,6 +567,7 @@ public Project createProject(Project project) throws GitLabApiException {
567
567
* requestAccessEnabled (optional) - Allow users to request member access
568
568
* repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins
569
569
* approvalsBeforeMerge (optional) - How many approvers should approve merge request by default
570
+ * printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line
570
571
*
571
572
* @param project the Project instance with the configuration for the new project
572
573
* @param importUrl the URL to import the repository from
@@ -606,7 +607,8 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
606
607
.withParam ("request_access_enabled" , project .getRequestAccessEnabled ())
607
608
.withParam ("repository_storage" , project .getRepositoryStorage ())
608
609
.withParam ("approvals_before_merge" , project .getApprovalsBeforeMerge ())
609
- .withParam ("import_url" , importUrl );
610
+ .withParam ("import_url" , importUrl )
611
+ .withParam ("printing_merge_request_link_enabled" , project .getPrintingMergeRequestLinkEnabled ());
610
612
611
613
if (isApiVersion (ApiVersion .V3 )) {
612
614
boolean isPublic = (project .getPublic () != null ? project .getPublic () : project .getVisibility () == Visibility .PUBLIC );
@@ -670,6 +672,54 @@ public Project createProject(String name, Integer namespaceId, String descriptio
670
672
return (response .readEntity (Project .class ));
671
673
}
672
674
675
+ /**
676
+ * Creates a Project
677
+ *
678
+ * @param name The name of the project
679
+ * @param namespaceId The Namespace for the new project, otherwise null indicates to use the GitLab default (user)
680
+ * @param description A description for the project, null otherwise
681
+ * @param issuesEnabled Whether Issues should be enabled, otherwise null indicates to use GitLab default
682
+ * @param mergeRequestsEnabled Whether Merge Requests should be enabled, otherwise null indicates to use GitLab default
683
+ * @param wikiEnabled Whether a Uncyclo should be enabled, otherwise null indicates to use GitLab default
684
+ * @param snippetsEnabled Whether Snippets should be enabled, otherwise null indicates to use GitLab default
685
+ * @param visibility The visibility of the project, otherwise null indicates to use GitLab default
686
+ * @param visibilityLevel The visibility level of the project, otherwise null indicates to use GitLab default
687
+ * @param printingMergeRequestLinkEnabled Show link to create/view merge request when pushing from the command line
688
+ * @param importUrl The Import URL for the project, otherwise null
689
+ * @return the GitLab Project
690
+ * @throws GitLabApiException if any exception occurs
691
+ */
692
+ public Project createProject (String name , Integer namespaceId , String description , Boolean issuesEnabled , Boolean mergeRequestsEnabled ,
693
+ Boolean wikiEnabled , Boolean snippetsEnabled , Visibility visibility , Integer visibilityLevel ,
694
+ Boolean printingMergeRequestLinkEnabled , String importUrl ) throws GitLabApiException {
695
+
696
+ if (isApiVersion (ApiVersion .V3 )) {
697
+ Boolean isPublic = Visibility .PUBLIC == visibility ;
698
+ return (createProject (name , namespaceId , description , issuesEnabled , mergeRequestsEnabled ,
699
+ wikiEnabled , snippetsEnabled , isPublic , visibilityLevel , importUrl ));
700
+ }
701
+
702
+ if (name == null || name .trim ().length () == 0 ) {
703
+ return (null );
704
+ }
705
+
706
+ GitLabApiForm formData = new GitLabApiForm ()
707
+ .withParam ("name" , name , true )
708
+ .withParam ("namespace_id" , namespaceId )
709
+ .withParam ("description" , description )
710
+ .withParam ("issues_enabled" , issuesEnabled )
711
+ .withParam ("merge_requests_enabled" , mergeRequestsEnabled )
712
+ .withParam ("wiki_enabled" , wikiEnabled )
713
+ .withParam ("snippets_enabled" , snippetsEnabled )
714
+ .withParam ("visibility_level" , visibilityLevel )
715
+ .withParam ("visibility" , visibility )
716
+ .withParam ("printing_merge_request_link_enabled" , printingMergeRequestLinkEnabled )
717
+ .withParam ("import_url" , importUrl );
718
+
719
+ Response response = post (Response .Status .CREATED , formData , "projects" );
720
+ return (response .readEntity (Project .class ));
721
+ }
722
+
673
723
/**
674
724
* Creates a Project
675
725
*
@@ -741,6 +791,7 @@ public Project createProject(String name, Integer namespaceId, String descriptio
741
791
* requestAccessEnabled (optional) - Allow users to request member access
742
792
* repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins
743
793
* approvalsBeforeMerge (optional) - How many approvers should approve merge request by default
794
+ * printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line
744
795
*
745
796
* NOTE: The following parameters specified by the GitLab API edit project are not supported:
746
797
* import_url
@@ -786,7 +837,8 @@ public Project updateProject(Project project) throws GitLabApiException {
786
837
.withParam ("lfs_enabled" , project .getLfsEnabled ())
787
838
.withParam ("request_access_enabled" , project .getRequestAccessEnabled ())
788
839
.withParam ("repository_storage" , project .getRepositoryStorage ())
789
- .withParam ("approvals_before_merge" , project .getApprovalsBeforeMerge ());
840
+ .withParam ("approvals_before_merge" , project .getApprovalsBeforeMerge ())
841
+ .withParam ("printing_merge_request_link_enabled" , project .getPrintingMergeRequestLinkEnabled ());
790
842
791
843
if (isApiVersion (ApiVersion .V3 )) {
792
844
formData .withParam ("visibility_level" , project .getVisibilityLevel ());
0 commit comments