diff --git a/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java b/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java index 61bd89a2..3cf53e49 100644 --- a/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java +++ b/app/src/main/java/org/mian/gitnex/interfaces/ApiInterface.java @@ -5,6 +5,7 @@ import org.mian.gitnex.models.AddEmail; import org.mian.gitnex.models.Branches; import org.mian.gitnex.models.ExploreRepositories; import org.mian.gitnex.models.Files; +import org.mian.gitnex.models.MergePullRequest; import org.mian.gitnex.models.NewFile; import org.mian.gitnex.models.PullRequests; import org.mian.gitnex.models.UpdateIssueAssignee; @@ -31,7 +32,6 @@ import org.mian.gitnex.models.UserSearch; import org.mian.gitnex.models.UserTokens; import org.mian.gitnex.models.WatchRepository; import java.util.List; - import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.http.Body; @@ -257,4 +257,6 @@ public interface ApiInterface { @GET("{owner}/{repo}/pulls/{filename}") // get pull diff file contents Call getFileDiffContents(@Path("owner") String owner, @Path("repo") String repo, @Path("filename") String fileName); + @POST("repos/{owner}/{repo}/pulls/{index}/merge") // merge a pull request + Call mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") String index, @Body MergePullRequest jsonStr); } diff --git a/app/src/main/java/org/mian/gitnex/models/MergePullRequest.java b/app/src/main/java/org/mian/gitnex/models/MergePullRequest.java new file mode 100644 index 00000000..6c59f636 --- /dev/null +++ b/app/src/main/java/org/mian/gitnex/models/MergePullRequest.java @@ -0,0 +1,19 @@ +package org.mian.gitnex.models; + +/** + * Author M M Arif + */ + +public class MergePullRequest { + + private String Do; + private String MergeMessageField; + private String MergeTitleField; + + public MergePullRequest(String Do, String MergeMessageField, String MergeTitleField) { + this.Do = Do; + this.MergeMessageField = MergeMessageField; + this.MergeTitleField = MergeTitleField; + } + +}