package com.alorma.github.sdk.services.pullrequest;

import com.alorma.github.sdk.bean.dto.response.Commit;
import com.alorma.github.sdk.bean.info.IssueInfo;
import com.alorma.github.sdk.services.client.GithubListClient;
import java.util.List;
import retrofit.RestAdapter;

/**
 * Created by Bernat on 17/06/2015.
 */
public class GetPullRequestCommits extends GithubListClient<List<Commit>> {

  private IssueInfo info;
  private int page;

  public GetPullRequestCommits(IssueInfo info) {
    this(info, 0);
  }

  public GetPullRequestCommits(IssueInfo info, int page) {
    super();
    this.info = info;
    this.page = page;
  }

  @Override
  protected ApiSubscriber getApiObservable(RestAdapter restAdapter) {
    return new ApiSubscriber() {
      @Override
      protected void call(RestAdapter restAdapter) {
        PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class);
        if (page == 0) {
          pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, this);
        } else {
          pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, nextPage,
              this);
        }
      }
    };
  }
}

@@ -271,52 +271,8 @@
 r;%0A%0A
-/**%0A * Created by Bernat on 17/06/2015.%0A */%0A
 publ
@@ -1152,11 +1152,132 @@
   %7D;%0A  %7D
+%0A%0A  @Override%0A  public String getAcceptHeader() %7B%0A    return %22application/vnd.github.cryptographer-preview+sha.json%22;%0A  %7D
 %0A%7D%0A

Update PullRequest commits to verification preview