{"action":"created","comment":{"url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/comments/34634411","id":34634411,"diff_hunk":"@@ -0,0 +1,416 @@\n+package io.keen.client.java;\n+\n+import java.util.Map;\n+import java.util.List;\n+import java.util.HashMap;\n+import java.util.ArrayList;\n+\n+/**\n+ * Created by claireyoung on 5/18/15.\n+ */\n+public class Query {\n+\n+    private QueryType queryType;\n+\n+    // required for all queries\n+    private String eventCollection;\n+\n+    // required by most queries\n+    private String targetProperty;\n+\n+    // optional\n+    private List<Map<String, Object>> filters;\n+    private String interval;    // requires timeframe to be set\n+    private String timezone;\n+    private ArrayList<String> groupBy;\n+    private Integer maxAge; // integer greater than 30 seconds: https://keen.io/docs/data-analysis/caching/\n+\n+    // required by the Percentile query\n+    private Double percentile;  // 0-100 with two decimal places of precision for example, 99.99\n+\n+\n+    /**\n+     * Constructs the map to pass to the JSON handler, so that the proper required\n+     * and optional Query arguments can be sent out to the server.\n+     *\n+     * @return The JSON object map.\n+     */\n+    public Map<String, Object> ConstructQueryArgs() {\n+\n+        Map<String, Object> queryArgs = new HashMap<String, Object>();\n+\n+        StringBuffer queryString = new StringBuffer();","path":"query/src/main/java/io/keen/client/java/Query.java","position":42,"original_position":42,"commit_id":"f67d0a38fc01dbab2652efaef2b1ec20e2e78c8f","original_commit_id":"f67d0a38fc01dbab2652efaef2b1ec20e2e78c8f","user":{"login":"Geeber","id":3165665,"avatar_url":"https://avatars.githubusercontent.com/u/3165665?v=3","gravatar_id":"","url":"https://api.github.com/users/Geeber","html_url":"https://github.com/Geeber","followers_url":"https://api.github.com/users/Geeber/followers","following_url":"https://api.github.com/users/Geeber/following{/other_user}","gists_url":"https://api.github.com/users/Geeber/gists{/gist_id}","starred_url":"https://api.github.com/users/Geeber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Geeber/subscriptions","organizations_url":"https://api.github.com/users/Geeber/orgs","repos_url":"https://api.github.com/users/Geeber/repos","events_url":"https://api.github.com/users/Geeber/events{/privacy}","received_events_url":"https://api.github.com/users/Geeber/received_events","type":"User","site_admin":false},"body":"Nit: You should probably be using `StringBuilder`, not `StringBuffer`. See here for more info: http://javahungry.blogspot.com/2013/06/difference-between-string-stringbuilder.html","created_at":"2015-07-15T00:08:32Z","updated_at":"2015-07-15T00:08:32Z","html_url":"https://github.com/keenlabs/KeenClient-Java/pull/52#discussion_r34634411","pull_request_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/comments/34634411"},"html":{"href":"https://github.com/keenlabs/KeenClient-Java/pull/52#discussion_r34634411"},"pull_request":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52","id":37545375,"html_url":"https://github.com/keenlabs/KeenClient-Java/pull/52","diff_url":"https://github.com/keenlabs/KeenClient-Java/pull/52.diff","patch_url":"https://github.com/keenlabs/KeenClient-Java/pull/52.patch","issue_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/52","number":52,"state":"open","locked":false,"title":"Query client","user":{"login":"Geeber","id":3165665,"avatar_url":"https://avatars.githubusercontent.com/u/3165665?v=3","gravatar_id":"","url":"https://api.github.com/users/Geeber","html_url":"https://github.com/Geeber","followers_url":"https://api.github.com/users/Geeber/followers","following_url":"https://api.github.com/users/Geeber/following{/other_user}","gists_url":"https://api.github.com/users/Geeber/gists{/gist_id}","starred_url":"https://api.github.com/users/Geeber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Geeber/subscriptions","organizations_url":"https://api.github.com/users/Geeber/orgs","repos_url":"https://api.github.com/users/Geeber/repos","events_url":"https://api.github.com/users/Geeber/events{/privacy}","received_events_url":"https://api.github.com/users/Geeber/received_events","type":"User","site_admin":false},"body":"Creating a pull request so we can discuss inline.","created_at":"2015-06-12T09:23:17Z","updated_at":"2015-07-15T00:08:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c5cc9b93741f6e483472e53f060e68d0096a5fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52/commits","review_comments_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52/comments","review_comment_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/52/comments","statuses_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/statuses/f67d0a38fc01dbab2652efaef2b1ec20e2e78c8f","head":{"label":"keenlabs:query-client","ref":"query-client","sha":"f67d0a38fc01dbab2652efaef2b1ec20e2e78c8f","user":{"login":"keenlabs","id":1315418,"avatar_url":"https://avatars.githubusercontent.com/u/1315418?v=3","gravatar_id":"","url":"https://api.github.com/users/keenlabs","html_url":"https://github.com/keenlabs","followers_url":"https://api.github.com/users/keenlabs/followers","following_url":"https://api.github.com/users/keenlabs/following{/other_user}","gists_url":"https://api.github.com/users/keenlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/keenlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keenlabs/subscriptions","organizations_url":"https://api.github.com/users/keenlabs/orgs","repos_url":"https://api.github.com/users/keenlabs/repos","events_url":"https://api.github.com/users/keenlabs/events{/privacy}","received_events_url":"https://api.github.com/users/keenlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":8023268,"name":"KeenClient-Java","full_name":"keenlabs/KeenClient-Java","owner":{"login":"keenlabs","id":1315418,"avatar_url":"https://avatars.githubusercontent.com/u/1315418?v=3","gravatar_id":"","url":"https://api.github.com/users/keenlabs","html_url":"https://github.com/keenlabs","followers_url":"https://api.github.com/users/keenlabs/followers","following_url":"https://api.github.com/users/keenlabs/following{/other_user}","gists_url":"https://api.github.com/users/keenlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/keenlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keenlabs/subscriptions","organizations_url":"https://api.github.com/users/keenlabs/orgs","repos_url":"https://api.github.com/users/keenlabs/repos","events_url":"https://api.github.com/users/keenlabs/events{/privacy}","received_events_url":"https://api.github.com/users/keenlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keenlabs/KeenClient-Java","description":"Official Java client for the Keen IO API. Build analytics features directly into your Java apps.","fork":false,"url":"https://api.github.com/repos/keenlabs/KeenClient-Java","forks_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/forks","keys_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/teams","hooks_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/hooks","issue_events_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/events{/number}","events_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/events","assignees_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/assignees{/user}","branches_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/branches{/branch}","tags_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/tags","blobs_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/refs{/sha}","trees_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/statuses/{sha}","languages_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/languages","stargazers_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/stargazers","contributors_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/contributors","subscribers_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/subscribers","subscription_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/subscription","commits_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/commits{/sha}","git_commits_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/commits{/sha}","comments_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/comments{/number}","issue_comment_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/comments{/number}","contents_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/contents/{+path}","compare_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/merges","archive_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/downloads","issues_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues{/number}","pulls_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls{/number}","milestones_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/milestones{/number}","notifications_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/labels{/name}","releases_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/releases{/id}","created_at":"2013-02-05T05:41:38Z","updated_at":"2015-07-05T16:14:01Z","pushed_at":"2015-07-10T10:48:01Z","git_url":"git://github.com/keenlabs/KeenClient-Java.git","ssh_url":"git@github.com:keenlabs/KeenClient-Java.git","clone_url":"https://github.com/keenlabs/KeenClient-Java.git","svn_url":"https://github.com/keenlabs/KeenClient-Java","homepage":"https://keen.io/docs","size":4676,"stargazers_count":45,"watchers_count":45,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":10,"forks":29,"open_issues":10,"watchers":45,"default_branch":"master"}},"base":{"label":"keenlabs:master","ref":"master","sha":"31226e6b549ce6fa36a6d7a647e87ef2ed21f966","user":{"login":"keenlabs","id":1315418,"avatar_url":"https://avatars.githubusercontent.com/u/1315418?v=3","gravatar_id":"","url":"https://api.github.com/users/keenlabs","html_url":"https://github.com/keenlabs","followers_url":"https://api.github.com/users/keenlabs/followers","following_url":"https://api.github.com/users/keenlabs/following{/other_user}","gists_url":"https://api.github.com/users/keenlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/keenlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keenlabs/subscriptions","organizations_url":"https://api.github.com/users/keenlabs/orgs","repos_url":"https://api.github.com/users/keenlabs/repos","events_url":"https://api.github.com/users/keenlabs/events{/privacy}","received_events_url":"https://api.github.com/users/keenlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":8023268,"name":"KeenClient-Java","full_name":"keenlabs/KeenClient-Java","owner":{"login":"keenlabs","id":1315418,"avatar_url":"https://avatars.githubusercontent.com/u/1315418?v=3","gravatar_id":"","url":"https://api.github.com/users/keenlabs","html_url":"https://github.com/keenlabs","followers_url":"https://api.github.com/users/keenlabs/followers","following_url":"https://api.github.com/users/keenlabs/following{/other_user}","gists_url":"https://api.github.com/users/keenlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/keenlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keenlabs/subscriptions","organizations_url":"https://api.github.com/users/keenlabs/orgs","repos_url":"https://api.github.com/users/keenlabs/repos","events_url":"https://api.github.com/users/keenlabs/events{/privacy}","received_events_url":"https://api.github.com/users/keenlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keenlabs/KeenClient-Java","description":"Official Java client for the Keen IO API. Build analytics features directly into your Java apps.","fork":false,"url":"https://api.github.com/repos/keenlabs/KeenClient-Java","forks_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/forks","keys_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/teams","hooks_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/hooks","issue_events_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/events{/number}","events_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/events","assignees_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/assignees{/user}","branches_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/branches{/branch}","tags_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/tags","blobs_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/refs{/sha}","trees_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/statuses/{sha}","languages_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/languages","stargazers_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/stargazers","contributors_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/contributors","subscribers_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/subscribers","subscription_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/subscription","commits_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/commits{/sha}","git_commits_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/git/commits{/sha}","comments_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/comments{/number}","issue_comment_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/comments{/number}","contents_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/contents/{+path}","compare_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/merges","archive_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/downloads","issues_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues{/number}","pulls_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls{/number}","milestones_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/milestones{/number}","notifications_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/labels{/name}","releases_url":"https://api.github.com/repos/keenlabs/KeenClient-Java/releases{/id}","created_at":"2013-02-05T05:41:38Z","updated_at":"2015-07-05T16:14:01Z","pushed_at":"2015-07-10T10:48:01Z","git_url":"git://github.com/keenlabs/KeenClient-Java.git","ssh_url":"git@github.com:keenlabs/KeenClient-Java.git","clone_url":"https://github.com/keenlabs/KeenClient-Java.git","svn_url":"https://github.com/keenlabs/KeenClient-Java","homepage":"https://keen.io/docs","size":4676,"stargazers_count":45,"watchers_count":45,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":10,"forks":29,"open_issues":10,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52"},"html":{"href":"https://github.com/keenlabs/KeenClient-Java/pull/52"},"issue":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/52"},"comments":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/keenlabs/KeenClient-Java/statuses/f67d0a38fc01dbab2652efaef2b1ec20e2e78c8f"}}}}