Added interface and model

This commit is contained in:
M M Arif 2019-11-25 19:19:13 +05:00
parent 0daf0d1110
commit 5b4cb3ff8e
2 changed files with 22 additions and 1 deletions

View File

@ -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<ResponseBody> 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> mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") String index, @Body MergePullRequest jsonStr);
}

View File

@ -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;
}
}