aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml/docilealligator/infinityforreddit/post/PollPayload.java
blob: c113a1064006a243ace3a25d1eadb6f51636f4a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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;
    }
}