{"action":"created","comment":{"url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/comments/48333148","id":48333148,"diff_hunk":"@@ -0,0 +1,365 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Threading.Tasks;\n+using RiotSharp.MatchEndpoint;\n+using RiotSharp.TournamentEndpoint;\n+using Newtonsoft.Json;\n+\n+namespace RiotSharp\n+{\n+    public class TournamentRiotApi : ITournamentRiotApi\n+    {\n+        private const string TournamentRootUrl = \"/tournament/public/v1\";\n+        private const string CreateCodeUrl = \"/code\";\n+        private const string GetCodeUrl = \"/code/{0}\";\n+        private const string PutCodeUrl = \"/code/{0}\";\n+        private const string LobbyEventUrl = \"/lobby/events/by-code/{0}\";\n+        private const string CreateProviderUrl = \"/provider\";\n+        private const string CreateTournamentUrl = \"/tournament\";\n+\n+        private const string MatchRootUrl = \"/api/lol/{0}/v2.2/match\";\n+        private const string GetMatchIdUrl = \"/by-tournament/{0}/ids\";\n+        private const string GetMatchDetailUrl = \"/for-tournament/{0}\";\n+\n+        private RateLimitedRequester requester;\n+\n+        private static TournamentRiotApi instance;\n+        /// <summary>\n+        /// Get the instance of RiotApi.\n+        /// </summary>\n+        /// <param name=\"apiKey\">The api key.</param>\n+        /// <param name=\"rateLimitPer10s\">The 10 seconds rate limit for your production api key.</param>\n+        /// <param name=\"rateLimitPer10m\">The 10 minutes rate limit for your production api key.</param>\n+        /// <returns>The instance of RiotApi.</returns>\n+        public static TournamentRiotApi GetInstance(string apiKey, int rateLimitPer10s = 10, int rateLimitPer10m = 500)\n+        {\n+            if (instance == null ||\n+                Requesters.TournamentRequester == null ||\n+                apiKey != Requesters.TournamentRequester.ApiKey ||\n+                rateLimitPer10s != Requesters.TournamentRequester.RateLimitPer10S ||\n+                rateLimitPer10m != Requesters.TournamentRequester.RateLimitPer10M)\n+            {\n+                instance = new TournamentRiotApi(apiKey, rateLimitPer10s, rateLimitPer10m);\n+            }\n+            return instance;\n+        }\n+\n+        internal static TournamentRiotApi GetInstance()\n+        {\n+            if (instance == null ||\n+                Requesters.TournamentRequester == null)\n+            {\n+                throw new NotSupportedException(\"Can't get instance of TournamentRiotApi. Use the overloaded method GetInstance(apikey, rateLimitPer10s, rateLimitPer10m) anywhere in your code before calling any tournament API method.\");","path":"RiotSharp/TournamentRiotApi.cs","position":52,"original_position":52,"commit_id":"9fce9dfdaf3a90ced6c21b4d3791bfb7b74c5d62","original_commit_id":"9fce9dfdaf3a90ced6c21b4d3791bfb7b74c5d62","user":{"login":"BenFradet","id":1737211,"avatar_url":"https://avatars.githubusercontent.com/u/1737211?v=3","gravatar_id":"","url":"https://api.github.com/users/BenFradet","html_url":"https://github.com/BenFradet","followers_url":"https://api.github.com/users/BenFradet/followers","following_url":"https://api.github.com/users/BenFradet/following{/other_user}","gists_url":"https://api.github.com/users/BenFradet/gists{/gist_id}","starred_url":"https://api.github.com/users/BenFradet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenFradet/subscriptions","organizations_url":"https://api.github.com/users/BenFradet/orgs","repos_url":"https://api.github.com/users/BenFradet/repos","events_url":"https://api.github.com/users/BenFradet/events{/privacy}","received_events_url":"https://api.github.com/users/BenFradet/received_events","type":"User","site_admin":false},"body":"\\> 120 chars","created_at":"2015-12-23T09:55:22Z","updated_at":"2015-12-23T09:55:22Z","html_url":"https://github.com/BenFradet/RiotSharp/pull/153#discussion_r48333148","pull_request_url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153","_links":{"self":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/comments/48333148"},"html":{"href":"https://github.com/BenFradet/RiotSharp/pull/153#discussion_r48333148"},"pull_request":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153","id":54408642,"html_url":"https://github.com/BenFradet/RiotSharp/pull/153","diff_url":"https://github.com/BenFradet/RiotSharp/pull/153.diff","patch_url":"https://github.com/BenFradet/RiotSharp/pull/153.patch","issue_url":"https://api.github.com/repos/BenFradet/RiotSharp/issues/153","number":153,"state":"open","locked":false,"title":"Implement Tournament API","user":{"login":"jvanvugt","id":8615579,"avatar_url":"https://avatars.githubusercontent.com/u/8615579?v=3","gravatar_id":"","url":"https://api.github.com/users/jvanvugt","html_url":"https://github.com/jvanvugt","followers_url":"https://api.github.com/users/jvanvugt/followers","following_url":"https://api.github.com/users/jvanvugt/following{/other_user}","gists_url":"https://api.github.com/users/jvanvugt/gists{/gist_id}","starred_url":"https://api.github.com/users/jvanvugt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvanvugt/subscriptions","organizations_url":"https://api.github.com/users/jvanvugt/orgs","repos_url":"https://api.github.com/users/jvanvugt/repos","events_url":"https://api.github.com/users/jvanvugt/events{/privacy}","received_events_url":"https://api.github.com/users/jvanvugt/received_events","type":"User","site_admin":false},"body":"@StevenReitsma and I implemented the Riot Tournament API (#152). We tried to adhere to the current structure of RiotSharp as much as possible. We also included tests and documentation. Some review would be much appreciated.","created_at":"2015-12-22T19:58:03Z","updated_at":"2015-12-23T09:55:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f661bd6a96125f28e5300b901edbc84550629a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153/commits","review_comments_url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153/comments","review_comment_url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BenFradet/RiotSharp/issues/153/comments","statuses_url":"https://api.github.com/repos/BenFradet/RiotSharp/statuses/9fce9dfdaf3a90ced6c21b4d3791bfb7b74c5d62","head":{"label":"jvanvugt:tournament_api","ref":"tournament_api","sha":"9fce9dfdaf3a90ced6c21b4d3791bfb7b74c5d62","user":{"login":"jvanvugt","id":8615579,"avatar_url":"https://avatars.githubusercontent.com/u/8615579?v=3","gravatar_id":"","url":"https://api.github.com/users/jvanvugt","html_url":"https://github.com/jvanvugt","followers_url":"https://api.github.com/users/jvanvugt/followers","following_url":"https://api.github.com/users/jvanvugt/following{/other_user}","gists_url":"https://api.github.com/users/jvanvugt/gists{/gist_id}","starred_url":"https://api.github.com/users/jvanvugt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvanvugt/subscriptions","organizations_url":"https://api.github.com/users/jvanvugt/orgs","repos_url":"https://api.github.com/users/jvanvugt/repos","events_url":"https://api.github.com/users/jvanvugt/events{/privacy}","received_events_url":"https://api.github.com/users/jvanvugt/received_events","type":"User","site_admin":false},"repo":{"id":48304433,"name":"RiotSharp","full_name":"jvanvugt/RiotSharp","owner":{"login":"jvanvugt","id":8615579,"avatar_url":"https://avatars.githubusercontent.com/u/8615579?v=3","gravatar_id":"","url":"https://api.github.com/users/jvanvugt","html_url":"https://github.com/jvanvugt","followers_url":"https://api.github.com/users/jvanvugt/followers","following_url":"https://api.github.com/users/jvanvugt/following{/other_user}","gists_url":"https://api.github.com/users/jvanvugt/gists{/gist_id}","starred_url":"https://api.github.com/users/jvanvugt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvanvugt/subscriptions","organizations_url":"https://api.github.com/users/jvanvugt/orgs","repos_url":"https://api.github.com/users/jvanvugt/repos","events_url":"https://api.github.com/users/jvanvugt/events{/privacy}","received_events_url":"https://api.github.com/users/jvanvugt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jvanvugt/RiotSharp","description":"C# wrapper for the Riot Games API","fork":true,"url":"https://api.github.com/repos/jvanvugt/RiotSharp","forks_url":"https://api.github.com/repos/jvanvugt/RiotSharp/forks","keys_url":"https://api.github.com/repos/jvanvugt/RiotSharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jvanvugt/RiotSharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jvanvugt/RiotSharp/teams","hooks_url":"https://api.github.com/repos/jvanvugt/RiotSharp/hooks","issue_events_url":"https://api.github.com/repos/jvanvugt/RiotSharp/issues/events{/number}","events_url":"https://api.github.com/repos/jvanvugt/RiotSharp/events","assignees_url":"https://api.github.com/repos/jvanvugt/RiotSharp/assignees{/user}","branches_url":"https://api.github.com/repos/jvanvugt/RiotSharp/branches{/branch}","tags_url":"https://api.github.com/repos/jvanvugt/RiotSharp/tags","blobs_url":"https://api.github.com/repos/jvanvugt/RiotSharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jvanvugt/RiotSharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jvanvugt/RiotSharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/jvanvugt/RiotSharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jvanvugt/RiotSharp/statuses/{sha}","languages_url":"https://api.github.com/repos/jvanvugt/RiotSharp/languages","stargazers_url":"https://api.github.com/repos/jvanvugt/RiotSharp/stargazers","contributors_url":"https://api.github.com/repos/jvanvugt/RiotSharp/contributors","subscribers_url":"https://api.github.com/repos/jvanvugt/RiotSharp/subscribers","subscription_url":"https://api.github.com/repos/jvanvugt/RiotSharp/subscription","commits_url":"https://api.github.com/repos/jvanvugt/RiotSharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/jvanvugt/RiotSharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/jvanvugt/RiotSharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/jvanvugt/RiotSharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/jvanvugt/RiotSharp/contents/{+path}","compare_url":"https://api.github.com/repos/jvanvugt/RiotSharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jvanvugt/RiotSharp/merges","archive_url":"https://api.github.com/repos/jvanvugt/RiotSharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jvanvugt/RiotSharp/downloads","issues_url":"https://api.github.com/repos/jvanvugt/RiotSharp/issues{/number}","pulls_url":"https://api.github.com/repos/jvanvugt/RiotSharp/pulls{/number}","milestones_url":"https://api.github.com/repos/jvanvugt/RiotSharp/milestones{/number}","notifications_url":"https://api.github.com/repos/jvanvugt/RiotSharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jvanvugt/RiotSharp/labels{/name}","releases_url":"https://api.github.com/repos/jvanvugt/RiotSharp/releases{/id}","created_at":"2015-12-20T02:23:32Z","updated_at":"2015-12-20T02:23:33Z","pushed_at":"2015-12-22T19:53:29Z","git_url":"git://github.com/jvanvugt/RiotSharp.git","ssh_url":"git@github.com:jvanvugt/RiotSharp.git","clone_url":"https://github.com/jvanvugt/RiotSharp.git","svn_url":"https://github.com/jvanvugt/RiotSharp","homepage":"","size":5027,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"develop"}},"base":{"label":"BenFradet:develop","ref":"develop","sha":"b391bc6f465ac60ccde2b123b670f1dae73a04f2","user":{"login":"BenFradet","id":1737211,"avatar_url":"https://avatars.githubusercontent.com/u/1737211?v=3","gravatar_id":"","url":"https://api.github.com/users/BenFradet","html_url":"https://github.com/BenFradet","followers_url":"https://api.github.com/users/BenFradet/followers","following_url":"https://api.github.com/users/BenFradet/following{/other_user}","gists_url":"https://api.github.com/users/BenFradet/gists{/gist_id}","starred_url":"https://api.github.com/users/BenFradet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenFradet/subscriptions","organizations_url":"https://api.github.com/users/BenFradet/orgs","repos_url":"https://api.github.com/users/BenFradet/repos","events_url":"https://api.github.com/users/BenFradet/events{/privacy}","received_events_url":"https://api.github.com/users/BenFradet/received_events","type":"User","site_admin":false},"repo":{"id":15112315,"name":"RiotSharp","full_name":"BenFradet/RiotSharp","owner":{"login":"BenFradet","id":1737211,"avatar_url":"https://avatars.githubusercontent.com/u/1737211?v=3","gravatar_id":"","url":"https://api.github.com/users/BenFradet","html_url":"https://github.com/BenFradet","followers_url":"https://api.github.com/users/BenFradet/followers","following_url":"https://api.github.com/users/BenFradet/following{/other_user}","gists_url":"https://api.github.com/users/BenFradet/gists{/gist_id}","starred_url":"https://api.github.com/users/BenFradet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenFradet/subscriptions","organizations_url":"https://api.github.com/users/BenFradet/orgs","repos_url":"https://api.github.com/users/BenFradet/repos","events_url":"https://api.github.com/users/BenFradet/events{/privacy}","received_events_url":"https://api.github.com/users/BenFradet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BenFradet/RiotSharp","description":"C# wrapper for the Riot Games API","fork":false,"url":"https://api.github.com/repos/BenFradet/RiotSharp","forks_url":"https://api.github.com/repos/BenFradet/RiotSharp/forks","keys_url":"https://api.github.com/repos/BenFradet/RiotSharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BenFradet/RiotSharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BenFradet/RiotSharp/teams","hooks_url":"https://api.github.com/repos/BenFradet/RiotSharp/hooks","issue_events_url":"https://api.github.com/repos/BenFradet/RiotSharp/issues/events{/number}","events_url":"https://api.github.com/repos/BenFradet/RiotSharp/events","assignees_url":"https://api.github.com/repos/BenFradet/RiotSharp/assignees{/user}","branches_url":"https://api.github.com/repos/BenFradet/RiotSharp/branches{/branch}","tags_url":"https://api.github.com/repos/BenFradet/RiotSharp/tags","blobs_url":"https://api.github.com/repos/BenFradet/RiotSharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BenFradet/RiotSharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BenFradet/RiotSharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/BenFradet/RiotSharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BenFradet/RiotSharp/statuses/{sha}","languages_url":"https://api.github.com/repos/BenFradet/RiotSharp/languages","stargazers_url":"https://api.github.com/repos/BenFradet/RiotSharp/stargazers","contributors_url":"https://api.github.com/repos/BenFradet/RiotSharp/contributors","subscribers_url":"https://api.github.com/repos/BenFradet/RiotSharp/subscribers","subscription_url":"https://api.github.com/repos/BenFradet/RiotSharp/subscription","commits_url":"https://api.github.com/repos/BenFradet/RiotSharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/BenFradet/RiotSharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/BenFradet/RiotSharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/BenFradet/RiotSharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/BenFradet/RiotSharp/contents/{+path}","compare_url":"https://api.github.com/repos/BenFradet/RiotSharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BenFradet/RiotSharp/merges","archive_url":"https://api.github.com/repos/BenFradet/RiotSharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BenFradet/RiotSharp/downloads","issues_url":"https://api.github.com/repos/BenFradet/RiotSharp/issues{/number}","pulls_url":"https://api.github.com/repos/BenFradet/RiotSharp/pulls{/number}","milestones_url":"https://api.github.com/repos/BenFradet/RiotSharp/milestones{/number}","notifications_url":"https://api.github.com/repos/BenFradet/RiotSharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BenFradet/RiotSharp/labels{/name}","releases_url":"https://api.github.com/repos/BenFradet/RiotSharp/releases{/id}","created_at":"2013-12-11T16:20:59Z","updated_at":"2015-12-19T10:28:57Z","pushed_at":"2015-12-22T19:58:03Z","git_url":"git://github.com/BenFradet/RiotSharp.git","ssh_url":"git@github.com:BenFradet/RiotSharp.git","clone_url":"https://github.com/BenFradet/RiotSharp.git","svn_url":"https://github.com/BenFradet/RiotSharp","homepage":"","size":5653,"stargazers_count":70,"watchers_count":70,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":9,"forks":48,"open_issues":9,"watchers":70,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153"},"html":{"href":"https://github.com/BenFradet/RiotSharp/pull/153"},"issue":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/issues/153"},"comments":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/BenFradet/RiotSharp/statuses/9fce9dfdaf3a90ced6c21b4d3791bfb7b74c5d62"}}}}