package ml.docilealligator.infinityforreddit.post; import com.google.gson.annotations.SerializedName; import ml.docilealligator.infinityforreddit.subreddit.Flair; public class PollPayload { @SerializedName("api_type") public String apiType = "json"; @SerializedName("duration") public int duration; @SerializedName("nsfw") public boolean isNsfw; public String[] options; @SerializedName("flair_id") public String flairId; @SerializedName("flair_text") public String flairText; @SerializedName("raw_rtjson") public String richTextJSON; @SerializedName("post_to_twitter") public boolean postToTwitter = false; @SerializedName("sendreplies") public boolean sendReplies; @SerializedName("show_error_list") public boolean showErrorList = true; @SerializedName("spoiler") public boolean isSpoiler; @SerializedName("sr") public String subredditName; @SerializedName("submit_type") public String submitType; public String text; public String title; @SerializedName("validate_on_submit") public boolean validateOnSubmit = true; public PollPayload(String subredditName, String title, String[] options, int duration, boolean isNsfw, boolean isSpoiler, Flair flair, boolean sendReplies, String submitType) { this.subredditName = subredditName; this.title = title; this.options = options; this.duration = duration; this.isNsfw = isNsfw; this.isSpoiler = isSpoiler; if (flair != null) { flairId = flair.getId(); flairText = flair.getText(); } this.sendReplies = sendReplies; this.submitType = submitType; } public PollPayload(String subredditName, String title, String[] options, int duration, boolean isNsfw, boolean isSpoiler, Flair flair, String richTextJSON, String text, boolean sendReplies, String submitType) { this.subredditName = subredditName; this.title = title; this.options = options; this.duration = duration; this.isNsfw = isNsfw; this.isSpoiler = isSpoiler; if (flair != null) { flairId = flair.getId(); flairText = flair.getText(); } this.richTextJSON = richTextJSON; this.text = text; this.sendReplies = sendReplies; this.submitType = submitType; } }