/// <summary> /// Get the instance of RiotApi. /// </summary> /// <param name="apiKey">The api key.</param> /// <param name="rateLimitPer10s">The 10 seconds rate limit for your production api key.</param> /// <param name="rateLimitPer10m">The 10 minutes rate limit for your production api key.</param> /// <returns>The instance of RiotApi.</returns> public static TournamentRiotApi GetInstance(string apiKey, int rateLimitPer10s = 10, int rateLimitPer10m = 500) { if (instance == null || Requesters.TournamentApiRequester == null || apiKey != Requesters.TournamentApiRequester.ApiKey || rateLimitPer10s != Requesters.TournamentApiRequester.RateLimitPer10S || rateLimitPer10m != Requesters.TournamentApiRequester.RateLimitPer10M) { instance = new TournamentRiotApi(apiKey, rateLimitPer10s, rateLimitPer10m); } return(instance); }
/// <summary> /// Get the instance of RiotApi. /// </summary> /// <param name="apiKey">The api key.</param> /// <param name="rateLimitPer10s">The 10 seconds rate limit for your production api key.</param> /// <param name="rateLimitPer10m">The 10 minutes rate limit for your production api key.</param> /// <returns>The instance of RiotApi.</returns> public static TournamentRiotApi GetInstance(string apiKey, int rateLimitPer10s = 10, int rateLimitPer10m = 500) { if (instance == null || Requesters.TournamentApiRequester == null || apiKey != Requesters.TournamentApiRequester.ApiKey || rateLimitPer10s != Requesters.TournamentApiRequester.RateLimitPer10S || rateLimitPer10m != Requesters.TournamentApiRequester.RateLimitPer10M) { instance = new TournamentRiotApi(apiKey, rateLimitPer10s, rateLimitPer10m); } return instance; }
/// <summary> /// Get the instance of TournamentRiotApi. /// </summary> /// <param name="apiKey">The api key.</param> /// <param name="rateLimits">A dictionary of rate limits where the key is the time span and the value /// is the number of requests allowed per that time span. Use null for no limits (default).</param> /// <param name="useStub">If true, the tournament stub will be used for requests. /// Useful for testing purposes.</param> /// <returns> /// The instance of TournamentRiotApi. /// </returns> public static TournamentRiotApi GetInstance(string apiKey, IDictionary <TimeSpan, int> rateLimits, bool useStub = false) { if (rateLimits == null) { rateLimits = new Dictionary <TimeSpan, int>(); } if (_instance == null || Requesters.TournamentApiRequester == null || apiKey != Requesters.TournamentApiRequester.ApiKey || !rateLimits.Equals(Requesters.TournamentApiRequester.RateLimits)) { _instance = new TournamentRiotApi(apiKey, rateLimits); } return(_instance); }