{"action":"created","comment":{"url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/comments/243051276","pull_request_review_id":186708004,"id":243051276,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzA1MTI3Ng==","diff_hunk":"@@ -0,0 +1,128 @@\n+/*\n+ * Copyright 2018 Dropbox, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package models.ebean;\n+\n+import java.util.Objects;\n+import javax.persistence.Column;\n+import javax.persistence.Entity;\n+import javax.persistence.EnumType;\n+import javax.persistence.Enumerated;\n+import javax.persistence.GeneratedValue;\n+import javax.persistence.GenerationType;\n+import javax.persistence.Id;\n+import javax.persistence.JoinColumn;\n+import javax.persistence.ManyToOne;\n+import javax.persistence.Table;\n+\n+/**\n+ * Data Model for SQL storage of a report recipient.\n+ *\n+ * @see ReportRecipient.RecipientType\n+ * @author Christian Briones (cbriones at dropbox dot com)\n+ */\n+// CHECKSTYLE.OFF: FinalClassCheck - Ebean requires the class to be non-final.\n+// CHECKSTYLE.OFF: MemberNameCheck\n+@Entity\n+@Table(name = \"report_recipients\", schema = \"portal\")\n+public class ReportRecipient {\n+    /**\n+     * The type of report recipient.\n+     */\n+    public enum RecipientType {\n+        /**\n+         * An email address.\n+         */\n+        EMAIL\n+    }\n+\n+    private ReportRecipient(final RecipientType typeValue, final String recipientValue) {\n+        type = typeValue;\n+        recipient = recipientValue;\n+    }\n+\n+    /**\n+     * Create a new ReportRecipient with the given emailAddress.\n+     * @param emailAddress The address of the recipient\n+     * @return A new email recipient.\n+     */\n+    public static ReportRecipient newEmailRecipient(final String emailAddress) {\n+        return new ReportRecipient(RecipientType.EMAIL, emailAddress);\n+    }\n+\n+    @Id\n+    @GeneratedValue(strategy = GenerationType.IDENTITY)\n+    @Column(name = \"id\")\n+    private Long id;\n+\n+    @ManyToOne\n+    @JoinColumn(name = \"recipient_group_id\")\n+    private ReportRecipientGroup recipientGroup;\n+\n+    @Column(name = \"recipient\")\n+    private String recipient;\n+\n+    @Enumerated(EnumType.STRING)\n+    @Column(name = \"type\")\n+    private RecipientType type;\n+\n+    public Long getId() {\n+        return id;\n+    }\n+\n+    /**\n+     * Get the address of this recipient.\n+     * @return The address of the recipient.\n+     */\n+    public String get() {\n+        return recipient;","path":"app/models/ebean/ReportRecipient.java","position":90,"original_position":90,"commit_id":"18f940a774fbddff9f3cce793fe64fcc7006e7a4","original_commit_id":"18f940a774fbddff9f3cce793fe64fcc7006e7a4","user":{"login":"vjkoskela","id":1775197,"node_id":"MDQ6VXNlcjE3NzUxOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/1775197?v=4","gravatar_id":"","url":"https://api.github.com/users/vjkoskela","html_url":"https://github.com/vjkoskela","followers_url":"https://api.github.com/users/vjkoskela/followers","following_url":"https://api.github.com/users/vjkoskela/following{/other_user}","gists_url":"https://api.github.com/users/vjkoskela/gists{/gist_id}","starred_url":"https://api.github.com/users/vjkoskela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjkoskela/subscriptions","organizations_url":"https://api.github.com/users/vjkoskela/orgs","repos_url":"https://api.github.com/users/vjkoskela/repos","events_url":"https://api.github.com/users/vjkoskela/events{/privacy}","received_events_url":"https://api.github.com/users/vjkoskela/received_events","type":"User","site_admin":false},"body":"Should this be discriminated and \"polymorphic\" as well?","created_at":"2018-12-19T19:46:00Z","updated_at":"2018-12-19T19:58:41Z","html_url":"https://github.com/ArpNetworking/metrics-portal/pull/134#discussion_r243051276","pull_request_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/comments/243051276"},"html":{"href":"https://github.com/ArpNetworking/metrics-portal/pull/134#discussion_r243051276"},"pull_request":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134"}},"in_reply_to_id":243047698},"pull_request":{"url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134","id":238875656,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4ODc1NjU2","html_url":"https://github.com/ArpNetworking/metrics-portal/pull/134","diff_url":"https://github.com/ArpNetworking/metrics-portal/pull/134.diff","patch_url":"https://github.com/ArpNetworking/metrics-portal/pull/134.patch","issue_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues/134","number":134,"state":"open","locked":false,"title":"Implement a SQL-backed storage layer for Reporting","user":{"login":"cwbriones","id":1554984,"node_id":"MDQ6VXNlcjE1NTQ5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1554984?v=4","gravatar_id":"","url":"https://api.github.com/users/cwbriones","html_url":"https://github.com/cwbriones","followers_url":"https://api.github.com/users/cwbriones/followers","following_url":"https://api.github.com/users/cwbriones/following{/other_user}","gists_url":"https://api.github.com/users/cwbriones/gists{/gist_id}","starred_url":"https://api.github.com/users/cwbriones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwbriones/subscriptions","organizations_url":"https://api.github.com/users/cwbriones/orgs","repos_url":"https://api.github.com/users/cwbriones/repos","events_url":"https://api.github.com/users/cwbriones/events{/privacy}","received_events_url":"https://api.github.com/users/cwbriones/received_events","type":"User","site_admin":false},"body":"This currently does not map the data model to the internal model, so the interfaces expose the data models right now (but nothing uses them).\r\n\r\nCode is mostly boilerplate and supports CRUD operations on a `ReportingJob` instance.\r\n\r\nThere is currently no notion of an execution history as we discussed, but I figured I can implement that some time after this to keep down the PR size.\r\n\r\n","created_at":"2018-12-15T00:18:48Z","updated_at":"2018-12-19T19:58:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2993217a0a433170672ece60e00f9b885eb71cb2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134/commits","review_comments_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134/comments","review_comment_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues/134/comments","statuses_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/statuses/18f940a774fbddff9f3cce793fe64fcc7006e7a4","head":{"label":"cwbriones:report_storage_rebased","ref":"report_storage_rebased","sha":"18f940a774fbddff9f3cce793fe64fcc7006e7a4","user":{"login":"cwbriones","id":1554984,"node_id":"MDQ6VXNlcjE1NTQ5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1554984?v=4","gravatar_id":"","url":"https://api.github.com/users/cwbriones","html_url":"https://github.com/cwbriones","followers_url":"https://api.github.com/users/cwbriones/followers","following_url":"https://api.github.com/users/cwbriones/following{/other_user}","gists_url":"https://api.github.com/users/cwbriones/gists{/gist_id}","starred_url":"https://api.github.com/users/cwbriones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwbriones/subscriptions","organizations_url":"https://api.github.com/users/cwbriones/orgs","repos_url":"https://api.github.com/users/cwbriones/repos","events_url":"https://api.github.com/users/cwbriones/events{/privacy}","received_events_url":"https://api.github.com/users/cwbriones/received_events","type":"User","site_admin":false},"repo":{"id":161853365,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE4NTMzNjU=","name":"metrics-portal","full_name":"cwbriones/metrics-portal","private":false,"owner":{"login":"cwbriones","id":1554984,"node_id":"MDQ6VXNlcjE1NTQ5ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1554984?v=4","gravatar_id":"","url":"https://api.github.com/users/cwbriones","html_url":"https://github.com/cwbriones","followers_url":"https://api.github.com/users/cwbriones/followers","following_url":"https://api.github.com/users/cwbriones/following{/other_user}","gists_url":"https://api.github.com/users/cwbriones/gists{/gist_id}","starred_url":"https://api.github.com/users/cwbriones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwbriones/subscriptions","organizations_url":"https://api.github.com/users/cwbriones/orgs","repos_url":"https://api.github.com/users/cwbriones/repos","events_url":"https://api.github.com/users/cwbriones/events{/privacy}","received_events_url":"https://api.github.com/users/cwbriones/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cwbriones/metrics-portal","description":null,"fork":true,"url":"https://api.github.com/repos/cwbriones/metrics-portal","forks_url":"https://api.github.com/repos/cwbriones/metrics-portal/forks","keys_url":"https://api.github.com/repos/cwbriones/metrics-portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cwbriones/metrics-portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cwbriones/metrics-portal/teams","hooks_url":"https://api.github.com/repos/cwbriones/metrics-portal/hooks","issue_events_url":"https://api.github.com/repos/cwbriones/metrics-portal/issues/events{/number}","events_url":"https://api.github.com/repos/cwbriones/metrics-portal/events","assignees_url":"https://api.github.com/repos/cwbriones/metrics-portal/assignees{/user}","branches_url":"https://api.github.com/repos/cwbriones/metrics-portal/branches{/branch}","tags_url":"https://api.github.com/repos/cwbriones/metrics-portal/tags","blobs_url":"https://api.github.com/repos/cwbriones/metrics-portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cwbriones/metrics-portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cwbriones/metrics-portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/cwbriones/metrics-portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cwbriones/metrics-portal/statuses/{sha}","languages_url":"https://api.github.com/repos/cwbriones/metrics-portal/languages","stargazers_url":"https://api.github.com/repos/cwbriones/metrics-portal/stargazers","contributors_url":"https://api.github.com/repos/cwbriones/metrics-portal/contributors","subscribers_url":"https://api.github.com/repos/cwbriones/metrics-portal/subscribers","subscription_url":"https://api.github.com/repos/cwbriones/metrics-portal/subscription","commits_url":"https://api.github.com/repos/cwbriones/metrics-portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/cwbriones/metrics-portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/cwbriones/metrics-portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/cwbriones/metrics-portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/cwbriones/metrics-portal/contents/{+path}","compare_url":"https://api.github.com/repos/cwbriones/metrics-portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cwbriones/metrics-portal/merges","archive_url":"https://api.github.com/repos/cwbriones/metrics-portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cwbriones/metrics-portal/downloads","issues_url":"https://api.github.com/repos/cwbriones/metrics-portal/issues{/number}","pulls_url":"https://api.github.com/repos/cwbriones/metrics-portal/pulls{/number}","milestones_url":"https://api.github.com/repos/cwbriones/metrics-portal/milestones{/number}","notifications_url":"https://api.github.com/repos/cwbriones/metrics-portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cwbriones/metrics-portal/labels{/name}","releases_url":"https://api.github.com/repos/cwbriones/metrics-portal/releases{/id}","deployments_url":"https://api.github.com/repos/cwbriones/metrics-portal/deployments","created_at":"2018-12-15T00:03:21Z","updated_at":"2018-12-15T00:03:24Z","pushed_at":"2018-12-17T19:00:13Z","git_url":"git://github.com/cwbriones/metrics-portal.git","ssh_url":"git@github.com:cwbriones/metrics-portal.git","clone_url":"https://github.com/cwbriones/metrics-portal.git","svn_url":"https://github.com/cwbriones/metrics-portal","homepage":null,"size":4152,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ArpNetworking:master","ref":"master","sha":"3c3f42f18dc2126f3b914fa81527bd0f7654ce2d","user":{"login":"ArpNetworking","id":7937343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MzczNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/7937343?v=4","gravatar_id":"","url":"https://api.github.com/users/ArpNetworking","html_url":"https://github.com/ArpNetworking","followers_url":"https://api.github.com/users/ArpNetworking/followers","following_url":"https://api.github.com/users/ArpNetworking/following{/other_user}","gists_url":"https://api.github.com/users/ArpNetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/ArpNetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArpNetworking/subscriptions","organizations_url":"https://api.github.com/users/ArpNetworking/orgs","repos_url":"https://api.github.com/users/ArpNetworking/repos","events_url":"https://api.github.com/users/ArpNetworking/events{/privacy}","received_events_url":"https://api.github.com/users/ArpNetworking/received_events","type":"Organization","site_admin":false},"repo":{"id":44266630,"node_id":"MDEwOlJlcG9zaXRvcnk0NDI2NjYzMA==","name":"metrics-portal","full_name":"ArpNetworking/metrics-portal","private":false,"owner":{"login":"ArpNetworking","id":7937343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MzczNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/7937343?v=4","gravatar_id":"","url":"https://api.github.com/users/ArpNetworking","html_url":"https://github.com/ArpNetworking","followers_url":"https://api.github.com/users/ArpNetworking/followers","following_url":"https://api.github.com/users/ArpNetworking/following{/other_user}","gists_url":"https://api.github.com/users/ArpNetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/ArpNetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArpNetworking/subscriptions","organizations_url":"https://api.github.com/users/ArpNetworking/orgs","repos_url":"https://api.github.com/users/ArpNetworking/repos","events_url":"https://api.github.com/users/ArpNetworking/events{/privacy}","received_events_url":"https://api.github.com/users/ArpNetworking/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ArpNetworking/metrics-portal","description":null,"fork":false,"url":"https://api.github.com/repos/ArpNetworking/metrics-portal","forks_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/forks","keys_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/teams","hooks_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/hooks","issue_events_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues/events{/number}","events_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/events","assignees_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/assignees{/user}","branches_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/branches{/branch}","tags_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/tags","blobs_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/statuses/{sha}","languages_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/languages","stargazers_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/stargazers","contributors_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/contributors","subscribers_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/subscribers","subscription_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/subscription","commits_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/contents/{+path}","compare_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/merges","archive_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/downloads","issues_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues{/number}","pulls_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls{/number}","milestones_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/milestones{/number}","notifications_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/labels{/name}","releases_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/releases{/id}","deployments_url":"https://api.github.com/repos/ArpNetworking/metrics-portal/deployments","created_at":"2015-10-14T18:03:17Z","updated_at":"2018-12-10T19:11:46Z","pushed_at":"2018-12-19T19:57:04Z","git_url":"git://github.com/ArpNetworking/metrics-portal.git","ssh_url":"git@github.com:ArpNetworking/metrics-portal.git","clone_url":"https://github.com/ArpNetworking/metrics-portal.git","svn_url":"https://github.com/ArpNetworking/metrics-portal","homepage":null,"size":3934,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":29,"license":null,"forks":9,"open_issues":29,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134"},"html":{"href":"https://github.com/ArpNetworking/metrics-portal/pull/134"},"issue":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues/134"},"comments":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/ArpNetworking/metrics-portal/statuses/18f940a774fbddff9f3cce793fe64fcc7006e7a4"}},"author_association":"NONE"}}
{"actor":{"display_login":"vjkoskela"}}