{"action":"created","comment":{"url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/comments/31077283","id":31077283,"diff_hunk":"@@ -339,4 +345,176 @@ public LeaderboardAndRank leaderboard(final @NonNull String leaderboardId) {\n         return RequestSender.send(request, LeaderboardAndRank.class);\n     }\n \n+    /**\n+     * Get a list of all matches the gamer is part of.\n+     *\n+     * @return A MatchList entity containing all matches relevant to the gamer.\n+     */\n+    public MatchList match() {\n+        final Request request = RequestFactory.get(\n+                new Uri.Builder().scheme(GameUp.SCHEME)\n+                        .encodedAuthority(GameUp.API_SERVER)\n+                        .appendPath(\"v0\")\n+                        .appendPath(\"gamer\")\n+                        .appendPath(\"match\")\n+                        .build(),\n+                apiKey,\n+                token);\n+\n+        return RequestSender.send(request, MatchList.class);\n+    }\n+\n+    /**\n+     * Get status and metadata for a single match identified by its string ID.\n+     *\n+     * @param matchId The String match identifier to retrieve data for.\n+     * @return The corresponding Match entity.\n+     */\n+    public Match match(final @NonNull String matchId) {\n+        final Request request = RequestFactory.get(\n+                new Uri.Builder().scheme(GameUp.SCHEME)\n+                        .encodedAuthority(GameUp.API_SERVER)\n+                        .appendPath(\"v0\")\n+                        .appendPath(\"gamer\")\n+                        .appendPath(\"match\")\n+                        .appendPath(matchId)\n+                        .build(),\n+                apiKey,\n+                token);\n+\n+        return RequestSender.send(request, Match.class);\n+    }\n+\n+    /**\n+     * Request a new match to be created by the GameUp service, with the total\n+     * number of gamers indicated; this player count includes the gamer making\n+     * the request.\n+     *\n+     * If there aren't enough waiting gamers to populate the match with, the\n+     * gamer will be added to the match queue instead.\n+     *\n+     * @param players The total number of gamers to populate the new match with.\n+     * @return The newly created Match entity, or null if the gamer was queued.\n+     */\n+    public Match match(final int players) {\n+        final Request request = RequestFactory.post(\n+                new Uri.Builder().scheme(GameUp.SCHEME)\n+                        .encodedAuthority(GameUp.API_SERVER)\n+                        .appendPath(\"v0\")\n+                        .appendPath(\"gamer\")\n+                        .appendPath(\"match\")\n+                        .build(),\n+                apiKey,\n+                token,\n+                GsonFactory.get().toJson(new MatchPlayers(players)));\n+\n+        return RequestSender.send(request, Match.class);\n+    }\n+\n+    /**\n+     * Leave or end an existing match.\n+     *\n+     * Leaving is allowed only when it is NOT the gamer's turn. Ending is only\n+     * allowed when it is the gamer's turn.\n+     *\n+     * @param matchId The match ID to submit the action to.\n+     * @param action The requested match action.\n+     */\n+    public void match(final @NonNull String matchId,\n+                      final @NonNull MatchAction.Type action) {\n+        final Request request = RequestFactory.post(\n+                new Uri.Builder().scheme(GameUp.SCHEME)\n+                        .encodedAuthority(GameUp.API_SERVER)\n+                        .appendPath(\"v0\")\n+                        .appendPath(\"gamer\")\n+                        .appendPath(\"match\")\n+                        .appendPath(matchId)\n+                        .build(),\n+                apiKey,\n+                token,\n+                GsonFactory.get().toJson(new MatchAction(action)));\n+\n+        RequestSender.send(request);\n+    }\n+\n+    /**\n+     * Get all turns for the specified match.\n+     *\n+     * @param matchId The match ID to retrieve turns for.\n+     * @return A TurnList containing all existing turns for the specified match.\n+     */\n+    public TurnList matchTurn(final @NonNull String matchId) {\n+        final Request request = RequestFactory.get(\n+                new Uri.Builder().scheme(GameUp.SCHEME)\n+                        .encodedAuthority(GameUp.API_SERVER)\n+                        .appendPath(\"v0\")\n+                        .appendPath(\"gamer\")\n+                        .appendPath(\"match\")\n+                        .appendPath(matchId)\n+                        .appendPath(\"turn\")\n+                        .build(),\n+                apiKey,\n+                token);\n+\n+        return RequestSender.send(request, TurnList.class);\n+    }\n+\n+    /**\n+     * For the specified match, get turns newer than the turn number specified.\n+     *\n+     * For example if lastTurn is 4, the response will contain turns 5+.\n+     *\n+     * @param matchId The match ID to retrieve turns for.\n+     * @param lastTurn The lower threshold for turn numbers.\n+     * @return A TurnList containing only the specified turns for the selected\n+     *         match.\n+     */\n+    public TurnList matchTurn(final @NonNull String matchId,\n+                              final int lastTurn) {\n+        final Request request = RequestFactory.get(\n+                new Uri.Builder().scheme(GameUp.SCHEME)\n+                        .encodedAuthority(GameUp.API_SERVER)\n+                        .appendPath(\"v0\")\n+                        .appendPath(\"gamer\")\n+                        .appendPath(\"match\")\n+                        .appendPath(matchId)\n+                        .appendPath(\"turn\")\n+                        .appendPath(Integer.toString(lastTurn))\n+                        .build(),\n+                apiKey,\n+                token);\n+\n+        return RequestSender.send(request, TurnList.class);\n+    }\n+\n+    /**\n+     * Submit a new turn to the specified match.\n+     *\n+     * @param matchId The match ID to submit the turn to.\n+     * @param lastTurn The number of the last turn seen by this client.\n+     * @param nextGamer The nickname of the gamer to select as the next\n+     *                  turn-taker.\n+     * @param data Arbitrary turn data. Can be a string or serialised object.\n+     */\n+    public void matchTurn(final @NonNull String matchId,","path":"sdk/src/main/java/io/gameup/android/GameUpSession.java","position":175,"original_position":175,"commit_id":"1aed3eab75f15d68e3e4d7e5a45cd3466cf57b5a","original_commit_id":"1aed3eab75f15d68e3e4d7e5a45cd3466cf57b5a","user":{"login":"zyro","id":308795,"avatar_url":"https://avatars.githubusercontent.com/u/308795?v=3","gravatar_id":"","url":"https://api.github.com/users/zyro","html_url":"https://github.com/zyro","followers_url":"https://api.github.com/users/zyro/followers","following_url":"https://api.github.com/users/zyro/following{/other_user}","gists_url":"https://api.github.com/users/zyro/gists{/gist_id}","starred_url":"https://api.github.com/users/zyro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyro/subscriptions","organizations_url":"https://api.github.com/users/zyro/orgs","repos_url":"https://api.github.com/users/zyro/repos","events_url":"https://api.github.com/users/zyro/events{/privacy}","received_events_url":"https://api.github.com/users/zyro/received_events","type":"User","site_admin":false},"body":"If the nextGamer is invalid (never existed, has left the game etc) the server returns a 400 error response.","created_at":"2015-05-26T20:40:21Z","updated_at":"2015-05-26T20:40:21Z","html_url":"https://github.com/gameup-io/gameup-android-sdk/pull/6#discussion_r31077283","pull_request_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/comments/31077283"},"html":{"href":"https://github.com/gameup-io/gameup-android-sdk/pull/6#discussion_r31077283"},"pull_request":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6","id":36139725,"html_url":"https://github.com/gameup-io/gameup-android-sdk/pull/6","diff_url":"https://github.com/gameup-io/gameup-android-sdk/pull/6.diff","patch_url":"https://github.com/gameup-io/gameup-android-sdk/pull/6.patch","issue_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/6","number":6,"state":"open","locked":false,"title":"Turn-based multiplayer","user":{"login":"zyro","id":308795,"avatar_url":"https://avatars.githubusercontent.com/u/308795?v=3","gravatar_id":"","url":"https://api.github.com/users/zyro","html_url":"https://github.com/zyro","followers_url":"https://api.github.com/users/zyro/followers","following_url":"https://api.github.com/users/zyro/following{/other_user}","gists_url":"https://api.github.com/users/zyro/gists{/gist_id}","starred_url":"https://api.github.com/users/zyro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyro/subscriptions","organizations_url":"https://api.github.com/users/zyro/orgs","repos_url":"https://api.github.com/users/zyro/repos","events_url":"https://api.github.com/users/zyro/events{/privacy}","received_events_url":"https://api.github.com/users/zyro/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-25T13:28:49Z","updated_at":"2015-05-26T20:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74389989897edc580369bd7824ad096f80d3917b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6/commits","review_comments_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6/comments","review_comment_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/6/comments","statuses_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/statuses/1aed3eab75f15d68e3e4d7e5a45cd3466cf57b5a","head":{"label":"gameup-io:aim-multiplayer","ref":"aim-multiplayer","sha":"1aed3eab75f15d68e3e4d7e5a45cd3466cf57b5a","user":{"login":"gameup-io","id":7188521,"avatar_url":"https://avatars.githubusercontent.com/u/7188521?v=3","gravatar_id":"","url":"https://api.github.com/users/gameup-io","html_url":"https://github.com/gameup-io","followers_url":"https://api.github.com/users/gameup-io/followers","following_url":"https://api.github.com/users/gameup-io/following{/other_user}","gists_url":"https://api.github.com/users/gameup-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gameup-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gameup-io/subscriptions","organizations_url":"https://api.github.com/users/gameup-io/orgs","repos_url":"https://api.github.com/users/gameup-io/repos","events_url":"https://api.github.com/users/gameup-io/events{/privacy}","received_events_url":"https://api.github.com/users/gameup-io/received_events","type":"Organization","site_admin":false},"repo":{"id":26530970,"name":"gameup-android-sdk","full_name":"gameup-io/gameup-android-sdk","owner":{"login":"gameup-io","id":7188521,"avatar_url":"https://avatars.githubusercontent.com/u/7188521?v=3","gravatar_id":"","url":"https://api.github.com/users/gameup-io","html_url":"https://github.com/gameup-io","followers_url":"https://api.github.com/users/gameup-io/followers","following_url":"https://api.github.com/users/gameup-io/following{/other_user}","gists_url":"https://api.github.com/users/gameup-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gameup-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gameup-io/subscriptions","organizations_url":"https://api.github.com/users/gameup-io/orgs","repos_url":"https://api.github.com/users/gameup-io/repos","events_url":"https://api.github.com/users/gameup-io/events{/privacy}","received_events_url":"https://api.github.com/users/gameup-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gameup-io/gameup-android-sdk","description":"Android SDK for the GameUp service.","fork":false,"url":"https://api.github.com/repos/gameup-io/gameup-android-sdk","forks_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/forks","keys_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/teams","hooks_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/events","assignees_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/tags","blobs_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/languages","stargazers_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/subscription","commits_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/merges","archive_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/downloads","issues_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/releases{/id}","created_at":"2014-11-12T10:31:41Z","updated_at":"2015-05-04T21:56:22Z","pushed_at":"2015-05-25T13:28:49Z","git_url":"git://github.com/gameup-io/gameup-android-sdk.git","ssh_url":"git@github.com:gameup-io/gameup-android-sdk.git","clone_url":"https://github.com/gameup-io/gameup-android-sdk.git","svn_url":"https://github.com/gameup-io/gameup-android-sdk","homepage":"https://gameup.io/docs/quickstart/android","size":939,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"gameup-io:master","ref":"master","sha":"7b10a820fe11cdd8658678497dbaa01e2002841e","user":{"login":"gameup-io","id":7188521,"avatar_url":"https://avatars.githubusercontent.com/u/7188521?v=3","gravatar_id":"","url":"https://api.github.com/users/gameup-io","html_url":"https://github.com/gameup-io","followers_url":"https://api.github.com/users/gameup-io/followers","following_url":"https://api.github.com/users/gameup-io/following{/other_user}","gists_url":"https://api.github.com/users/gameup-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gameup-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gameup-io/subscriptions","organizations_url":"https://api.github.com/users/gameup-io/orgs","repos_url":"https://api.github.com/users/gameup-io/repos","events_url":"https://api.github.com/users/gameup-io/events{/privacy}","received_events_url":"https://api.github.com/users/gameup-io/received_events","type":"Organization","site_admin":false},"repo":{"id":26530970,"name":"gameup-android-sdk","full_name":"gameup-io/gameup-android-sdk","owner":{"login":"gameup-io","id":7188521,"avatar_url":"https://avatars.githubusercontent.com/u/7188521?v=3","gravatar_id":"","url":"https://api.github.com/users/gameup-io","html_url":"https://github.com/gameup-io","followers_url":"https://api.github.com/users/gameup-io/followers","following_url":"https://api.github.com/users/gameup-io/following{/other_user}","gists_url":"https://api.github.com/users/gameup-io/gists{/gist_id}","starred_url":"https://api.github.com/users/gameup-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gameup-io/subscriptions","organizations_url":"https://api.github.com/users/gameup-io/orgs","repos_url":"https://api.github.com/users/gameup-io/repos","events_url":"https://api.github.com/users/gameup-io/events{/privacy}","received_events_url":"https://api.github.com/users/gameup-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gameup-io/gameup-android-sdk","description":"Android SDK for the GameUp service.","fork":false,"url":"https://api.github.com/repos/gameup-io/gameup-android-sdk","forks_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/forks","keys_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/teams","hooks_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/events","assignees_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/tags","blobs_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/languages","stargazers_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/subscription","commits_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/merges","archive_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/downloads","issues_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/gameup-io/gameup-android-sdk/releases{/id}","created_at":"2014-11-12T10:31:41Z","updated_at":"2015-05-04T21:56:22Z","pushed_at":"2015-05-25T13:28:49Z","git_url":"git://github.com/gameup-io/gameup-android-sdk.git","ssh_url":"git@github.com:gameup-io/gameup-android-sdk.git","clone_url":"https://github.com/gameup-io/gameup-android-sdk.git","svn_url":"https://github.com/gameup-io/gameup-android-sdk","homepage":"https://gameup.io/docs/quickstart/android","size":939,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6"},"html":{"href":"https://github.com/gameup-io/gameup-android-sdk/pull/6"},"issue":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/6"},"comments":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/gameup-io/gameup-android-sdk/statuses/1aed3eab75f15d68e3e4d7e5a45cd3466cf57b5a"}}}}