{"action":"created","comment":{"url":"https://api.github.com/repos/messenger4j/messenger4j/pulls/comments/91272548","pull_request_review_id":11779100,"id":91272548,"diff_hunk":"@@ -0,0 +1,296 @@\n+package com.github.messenger4j.send.templates;\n+\n+import com.github.messenger4j.internal.Assert;\n+import com.github.messenger4j.send.buttons.Button;\n+import com.google.gson.annotations.SerializedName;\n+\n+import java.util.ArrayList;\n+import java.util.Collections;\n+import java.util.List;\n+import java.util.Objects;\n+\n+/**\n+ * @author Jan Zarnikov\n+ * @since 0.6.2\n+ */\n+public final class ListTemplate extends Template {\n+\n+    @SerializedName(\"top_element_style\")\n+    private final TopElementStyle topElementStyle;\n+    private final List<Button> buttons;\n+    private final List<Element> elements;\n+\n+    public static Builder newBuilder(TopElementStyle topElementStyle) {\n+        return new Builder(topElementStyle);\n+    }\n+\n+    private ListTemplate(Builder builder) {\n+        super(TemplateType.LIST);\n+        this.topElementStyle = builder.topElementStyle;\n+        this.buttons = builder.buttons;\n+        this.elements = builder.elements;\n+    }\n+\n+    public enum TopElementStyle {\n+        @SerializedName(\"large\")\n+        LARGE,\n+\n+        @SerializedName(\"compact\")\n+        COMPACT\n+    }\n+\n+    @Override\n+    public boolean equals(Object o) {\n+        if (this == o) return true;\n+        if (o == null || getClass() != o.getClass()) return false;\n+        if (!super.equals(o)) return false;\n+        ListTemplate that = (ListTemplate) o;\n+        return topElementStyle == that.topElementStyle &&\n+                Objects.equals(buttons, that.buttons) &&\n+                Objects.equals(elements, that.elements);\n+    }\n+\n+    @Override\n+    public int hashCode() {\n+        return Objects.hash(super.hashCode(), topElementStyle, buttons, elements);\n+    }\n+\n+    @Override\n+    public String toString() {\n+        return \"ListTemplate{\" +\n+                \"topElementStyle=\" + topElementStyle +\n+                \", buttons=\" + buttons +\n+                \", elements=\" + elements +\n+                '}';\n+    }\n+\n+    public static final class Builder {\n+\n+        public static final int BUTTONS_LIMIT = 1;\n+        private final TopElementStyle topElementStyle;\n+\n+        private List<Button> buttons;\n+        private List<Element> elements;\n+\n+        public Builder(TopElementStyle topElementStyle) {\n+            this.topElementStyle = topElementStyle;","path":"src/main/java/com/github/messenger4j/send/templates/ListTemplate.java","position":76,"original_position":76,"commit_id":"065714a3a1963cc0fcb3a982cedeeef7855ac433","original_commit_id":"065714a3a1963cc0fcb3a982cedeeef7855ac433","user":{"login":"maxgrabenhorst","id":3321003,"avatar_url":"https://avatars.githubusercontent.com/u/3321003?v=3","gravatar_id":"","url":"https://api.github.com/users/maxgrabenhorst","html_url":"https://github.com/maxgrabenhorst","followers_url":"https://api.github.com/users/maxgrabenhorst/followers","following_url":"https://api.github.com/users/maxgrabenhorst/following{/other_user}","gists_url":"https://api.github.com/users/maxgrabenhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/maxgrabenhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxgrabenhorst/subscriptions","organizations_url":"https://api.github.com/users/maxgrabenhorst/orgs","repos_url":"https://api.github.com/users/maxgrabenhorst/repos","events_url":"https://api.github.com/users/maxgrabenhorst/events{/privacy}","received_events_url":"https://api.github.com/users/maxgrabenhorst/received_events","type":"User","site_admin":false},"body":"According the Messenger spec it is not required to provide a top element style (defaults to compact) but I think its a good practice to decide first what type of list template you want to create. Just a remark. No changes needed here.","created_at":"2016-12-07T11:15:02Z","updated_at":"2016-12-07T11:15:02Z","html_url":"https://github.com/messenger4j/messenger4j/pull/3#discussion_r91272548","pull_request_url":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/messenger4j/messenger4j/pulls/comments/91272548"},"html":{"href":"https://github.com/messenger4j/messenger4j/pull/3#discussion_r91272548"},"pull_request":{"href":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3","id":95857299,"html_url":"https://github.com/messenger4j/messenger4j/pull/3","diff_url":"https://github.com/messenger4j/messenger4j/pull/3.diff","patch_url":"https://github.com/messenger4j/messenger4j/pull/3.patch","issue_url":"https://api.github.com/repos/messenger4j/messenger4j/issues/3","number":3,"state":"open","locked":false,"title":"changed constructors of event classes to public ","user":{"login":"jzarnikov","id":280097,"avatar_url":"https://avatars.githubusercontent.com/u/280097?v=3","gravatar_id":"","url":"https://api.github.com/users/jzarnikov","html_url":"https://github.com/jzarnikov","followers_url":"https://api.github.com/users/jzarnikov/followers","following_url":"https://api.github.com/users/jzarnikov/following{/other_user}","gists_url":"https://api.github.com/users/jzarnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/jzarnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzarnikov/subscriptions","organizations_url":"https://api.github.com/users/jzarnikov/orgs","repos_url":"https://api.github.com/users/jzarnikov/repos","events_url":"https://api.github.com/users/jzarnikov/events{/privacy}","received_events_url":"https://api.github.com/users/jzarnikov/received_events","type":"User","site_admin":false},"body":"so they can be instatiated in tests of users of this library.\r\n\r\nhttps://github.com/messenger4j/messenger4j/issues/2","created_at":"2016-11-30T09:42:09Z","updated_at":"2016-12-07T11:27:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a81eaf4b7c25eba858ff92d715174bb05341bcbe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3/commits","review_comments_url":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3/comments","review_comment_url":"https://api.github.com/repos/messenger4j/messenger4j/pulls/comments{/number}","comments_url":"https://api.github.com/repos/messenger4j/messenger4j/issues/3/comments","statuses_url":"https://api.github.com/repos/messenger4j/messenger4j/statuses/065714a3a1963cc0fcb3a982cedeeef7855ac433","head":{"label":"jzarnikov:master","ref":"master","sha":"065714a3a1963cc0fcb3a982cedeeef7855ac433","user":{"login":"jzarnikov","id":280097,"avatar_url":"https://avatars.githubusercontent.com/u/280097?v=3","gravatar_id":"","url":"https://api.github.com/users/jzarnikov","html_url":"https://github.com/jzarnikov","followers_url":"https://api.github.com/users/jzarnikov/followers","following_url":"https://api.github.com/users/jzarnikov/following{/other_user}","gists_url":"https://api.github.com/users/jzarnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/jzarnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzarnikov/subscriptions","organizations_url":"https://api.github.com/users/jzarnikov/orgs","repos_url":"https://api.github.com/users/jzarnikov/repos","events_url":"https://api.github.com/users/jzarnikov/events{/privacy}","received_events_url":"https://api.github.com/users/jzarnikov/received_events","type":"User","site_admin":false},"repo":{"id":75172012,"name":"messenger4j","full_name":"jzarnikov/messenger4j","owner":{"login":"jzarnikov","id":280097,"avatar_url":"https://avatars.githubusercontent.com/u/280097?v=3","gravatar_id":"","url":"https://api.github.com/users/jzarnikov","html_url":"https://github.com/jzarnikov","followers_url":"https://api.github.com/users/jzarnikov/followers","following_url":"https://api.github.com/users/jzarnikov/following{/other_user}","gists_url":"https://api.github.com/users/jzarnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/jzarnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzarnikov/subscriptions","organizations_url":"https://api.github.com/users/jzarnikov/orgs","repos_url":"https://api.github.com/users/jzarnikov/repos","events_url":"https://api.github.com/users/jzarnikov/events{/privacy}","received_events_url":"https://api.github.com/users/jzarnikov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jzarnikov/messenger4j","description":"The ultimate Java library for the Facebook Messenger Platform API. It's fast, lightweight, feature-rich, and so easy to use.","fork":true,"url":"https://api.github.com/repos/jzarnikov/messenger4j","forks_url":"https://api.github.com/repos/jzarnikov/messenger4j/forks","keys_url":"https://api.github.com/repos/jzarnikov/messenger4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jzarnikov/messenger4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jzarnikov/messenger4j/teams","hooks_url":"https://api.github.com/repos/jzarnikov/messenger4j/hooks","issue_events_url":"https://api.github.com/repos/jzarnikov/messenger4j/issues/events{/number}","events_url":"https://api.github.com/repos/jzarnikov/messenger4j/events","assignees_url":"https://api.github.com/repos/jzarnikov/messenger4j/assignees{/user}","branches_url":"https://api.github.com/repos/jzarnikov/messenger4j/branches{/branch}","tags_url":"https://api.github.com/repos/jzarnikov/messenger4j/tags","blobs_url":"https://api.github.com/repos/jzarnikov/messenger4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jzarnikov/messenger4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jzarnikov/messenger4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/jzarnikov/messenger4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jzarnikov/messenger4j/statuses/{sha}","languages_url":"https://api.github.com/repos/jzarnikov/messenger4j/languages","stargazers_url":"https://api.github.com/repos/jzarnikov/messenger4j/stargazers","contributors_url":"https://api.github.com/repos/jzarnikov/messenger4j/contributors","subscribers_url":"https://api.github.com/repos/jzarnikov/messenger4j/subscribers","subscription_url":"https://api.github.com/repos/jzarnikov/messenger4j/subscription","commits_url":"https://api.github.com/repos/jzarnikov/messenger4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/jzarnikov/messenger4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/jzarnikov/messenger4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/jzarnikov/messenger4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/jzarnikov/messenger4j/contents/{+path}","compare_url":"https://api.github.com/repos/jzarnikov/messenger4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jzarnikov/messenger4j/merges","archive_url":"https://api.github.com/repos/jzarnikov/messenger4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jzarnikov/messenger4j/downloads","issues_url":"https://api.github.com/repos/jzarnikov/messenger4j/issues{/number}","pulls_url":"https://api.github.com/repos/jzarnikov/messenger4j/pulls{/number}","milestones_url":"https://api.github.com/repos/jzarnikov/messenger4j/milestones{/number}","notifications_url":"https://api.github.com/repos/jzarnikov/messenger4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jzarnikov/messenger4j/labels{/name}","releases_url":"https://api.github.com/repos/jzarnikov/messenger4j/releases{/id}","deployments_url":"https://api.github.com/repos/jzarnikov/messenger4j/deployments","created_at":"2016-11-30T09:31:27Z","updated_at":"2016-12-05T18:12:49Z","pushed_at":"2016-12-06T16:45:59Z","git_url":"git://github.com/jzarnikov/messenger4j.git","ssh_url":"git@github.com:jzarnikov/messenger4j.git","clone_url":"https://github.com/jzarnikov/messenger4j.git","svn_url":"https://github.com/jzarnikov/messenger4j","homepage":"","size":65,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"messenger4j:master","ref":"master","sha":"7313c9f9f765cf0bcdb19ef18331ae73390b21c7","user":{"login":"messenger4j","id":23582287,"avatar_url":"https://avatars.githubusercontent.com/u/23582287?v=3","gravatar_id":"","url":"https://api.github.com/users/messenger4j","html_url":"https://github.com/messenger4j","followers_url":"https://api.github.com/users/messenger4j/followers","following_url":"https://api.github.com/users/messenger4j/following{/other_user}","gists_url":"https://api.github.com/users/messenger4j/gists{/gist_id}","starred_url":"https://api.github.com/users/messenger4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/messenger4j/subscriptions","organizations_url":"https://api.github.com/users/messenger4j/orgs","repos_url":"https://api.github.com/users/messenger4j/repos","events_url":"https://api.github.com/users/messenger4j/events{/privacy}","received_events_url":"https://api.github.com/users/messenger4j/received_events","type":"Organization","site_admin":false},"repo":{"id":74203633,"name":"messenger4j","full_name":"messenger4j/messenger4j","owner":{"login":"messenger4j","id":23582287,"avatar_url":"https://avatars.githubusercontent.com/u/23582287?v=3","gravatar_id":"","url":"https://api.github.com/users/messenger4j","html_url":"https://github.com/messenger4j","followers_url":"https://api.github.com/users/messenger4j/followers","following_url":"https://api.github.com/users/messenger4j/following{/other_user}","gists_url":"https://api.github.com/users/messenger4j/gists{/gist_id}","starred_url":"https://api.github.com/users/messenger4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/messenger4j/subscriptions","organizations_url":"https://api.github.com/users/messenger4j/orgs","repos_url":"https://api.github.com/users/messenger4j/repos","events_url":"https://api.github.com/users/messenger4j/events{/privacy}","received_events_url":"https://api.github.com/users/messenger4j/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/messenger4j/messenger4j","description":"The ultimate Java library for the Facebook Messenger Platform API. It's fast, lightweight, feature-rich, and so easy to use.","fork":false,"url":"https://api.github.com/repos/messenger4j/messenger4j","forks_url":"https://api.github.com/repos/messenger4j/messenger4j/forks","keys_url":"https://api.github.com/repos/messenger4j/messenger4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/messenger4j/messenger4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/messenger4j/messenger4j/teams","hooks_url":"https://api.github.com/repos/messenger4j/messenger4j/hooks","issue_events_url":"https://api.github.com/repos/messenger4j/messenger4j/issues/events{/number}","events_url":"https://api.github.com/repos/messenger4j/messenger4j/events","assignees_url":"https://api.github.com/repos/messenger4j/messenger4j/assignees{/user}","branches_url":"https://api.github.com/repos/messenger4j/messenger4j/branches{/branch}","tags_url":"https://api.github.com/repos/messenger4j/messenger4j/tags","blobs_url":"https://api.github.com/repos/messenger4j/messenger4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/messenger4j/messenger4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/messenger4j/messenger4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/messenger4j/messenger4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/messenger4j/messenger4j/statuses/{sha}","languages_url":"https://api.github.com/repos/messenger4j/messenger4j/languages","stargazers_url":"https://api.github.com/repos/messenger4j/messenger4j/stargazers","contributors_url":"https://api.github.com/repos/messenger4j/messenger4j/contributors","subscribers_url":"https://api.github.com/repos/messenger4j/messenger4j/subscribers","subscription_url":"https://api.github.com/repos/messenger4j/messenger4j/subscription","commits_url":"https://api.github.com/repos/messenger4j/messenger4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/messenger4j/messenger4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/messenger4j/messenger4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/messenger4j/messenger4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/messenger4j/messenger4j/contents/{+path}","compare_url":"https://api.github.com/repos/messenger4j/messenger4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/messenger4j/messenger4j/merges","archive_url":"https://api.github.com/repos/messenger4j/messenger4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/messenger4j/messenger4j/downloads","issues_url":"https://api.github.com/repos/messenger4j/messenger4j/issues{/number}","pulls_url":"https://api.github.com/repos/messenger4j/messenger4j/pulls{/number}","milestones_url":"https://api.github.com/repos/messenger4j/messenger4j/milestones{/number}","notifications_url":"https://api.github.com/repos/messenger4j/messenger4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/messenger4j/messenger4j/labels{/name}","releases_url":"https://api.github.com/repos/messenger4j/messenger4j/releases{/id}","deployments_url":"https://api.github.com/repos/messenger4j/messenger4j/deployments","created_at":"2016-11-19T11:10:39Z","updated_at":"2016-12-07T10:55:35Z","pushed_at":"2016-12-06T16:45:59Z","git_url":"git://github.com/messenger4j/messenger4j.git","ssh_url":"git@github.com:messenger4j/messenger4j.git","clone_url":"https://github.com/messenger4j/messenger4j.git","svn_url":"https://github.com/messenger4j/messenger4j","homepage":"","size":64,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3"},"html":{"href":"https://github.com/messenger4j/messenger4j/pull/3"},"issue":{"href":"https://api.github.com/repos/messenger4j/messenger4j/issues/3"},"comments":{"href":"https://api.github.com/repos/messenger4j/messenger4j/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/messenger4j/messenger4j/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/messenger4j/messenger4j/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/messenger4j/messenger4j/statuses/065714a3a1963cc0fcb3a982cedeeef7855ac433"}}}}
{"actor":{"display_login":"maxgrabenhorst"}}