@@ -745,7 +745,9 @@ public GHRepository forkTo(GHOrganization org) throws IOException {
745745 * Retrieves a specified pull request.
746746 */
747747 public GHPullRequest getPullRequest (int i ) throws IOException {
748- return root .retrieve ().to (getApiTailUrl ("pulls/" + i ), GHPullRequest .class ).wrapUp (this );
748+ return root .retrieve ()
749+ .withPreview (SHADOW_CAT )
750+ .to (getApiTailUrl ("pulls/" + i ), GHPullRequest .class ).wrapUp (this );
749751 }
750752
751753 /**
@@ -814,11 +816,39 @@ public GHPullRequest createPullRequest(String title, String head, String base, S
814816 */
815817 public GHPullRequest createPullRequest (String title , String head , String base , String body ,
816818 boolean maintainerCanModify ) throws IOException {
817- return new Requester (root ).with ("title" ,title )
819+ return createPullRequest (title , head , base , body , maintainerCanModify , false );
820+ }
821+
822+ /**
823+ * Creates a new pull request. Maintainer's permissions and draft aware.
824+ *
825+ * @param title
826+ * Required. The title of the pull request.
827+ * @param head
828+ * Required. The name of the branch where your changes are implemented.
829+ * For cross-repository pull requests in the same network,
830+ * namespace head with a user like this: username:branch.
831+ * @param base
832+ * Required. The name of the branch you want your changes pulled into.
833+ * This should be an existing branch on the current repository.
834+ * @param body
835+ * The contents of the pull request. This is the markdown description
836+ * of a pull request.
837+ * @param maintainerCanModify
838+ * Indicates whether maintainers can modify the pull request.
839+ * @param draft
840+ * Indicates whether to create a draft pull request or not.
841+ */
842+ public GHPullRequest createPullRequest (String title , String head , String base , String body ,
843+ boolean maintainerCanModify , boolean draft ) throws IOException {
844+ return new Requester (root )
845+ .withPreview (SHADOW_CAT )
846+ .with ("title" ,title )
818847 .with ("head" ,head )
819848 .with ("base" ,base )
820849 .with ("body" ,body )
821850 .with ("maintainer_can_modify" , maintainerCanModify )
851+ .with ("draft" , draft )
822852 .to (getApiTailUrl ("pulls" ),GHPullRequest .class )
823853 .wrapUp (this );
824854 }
0 commit comments