

package com.meisolsson.githubsdk.model;

import android.support.annotation.Nullable;

import com.google.auto.value.AutoValue;
import com.squareup.moshi.Json;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;


@AutoValue
public abstract class ReviewComment extends PositionalCommentBase {

    @Json(name = "diff_hunk")
    @Nullable
    public abstract String diffChunk();

    @Json(name = "original_commit_id")
    @Nullable
    public abstract String originalCommitId();

    @Json(name = "original_position")
    @Nullable
    public abstract Integer originalPosition();

    @Json(name = "pull_request_review_id")
    @Nullable
    public abstract Integer pullRequestReviewId();

    public abstract Builder toBuilder();

    @Json(name = "pull_request_url")
    @Nullable
    public abstract String pullRequestUrl();

    public static JsonAdapter<ReviewComment> jsonAdapter(Moshi moshi) {
        return new AutoValue_ReviewComment.MoshiJsonAdapter(moshi);
    }

    @AutoValue.Builder
    public abstract static class Builder extends PositionalCommentBase.Builder<Builder> {
        public abstract Builder diffChunk(String diffChunk);

        public abstract Builder originalCommitId(String originalCommitId);

        public abstract Builder originalPosition(Integer originalPosition);

        public abstract Builder pullRequestReviewId(Integer pullRequestReviewId);

        public abstract Builder pullRequestUrl(String pullRequestUrl);

        public abstract ReviewComment build();
    }
}
