/// <summary> /// </summary> /// <param name="type"> /// </param> /// <param name="names"> /// </param> /// <param name="limits"> /// </param> /// <param name="methods"> /// </param> /// <returns> /// </returns> public RateLimitBuilder AddRateLimitFor(LolUrlType type, List <LolApiName> names, List <ApiLimit> limits, params LolApiMethodName[] methods) { var rla = new RLolApiName(); var rlan = new RLolApiMethodName(); rlan.Add(names, methods.Distinct().ToArray()); rlan.AddLimit(limits.ToArray()); rla.Add(rlan); if (!Limits.ContainsKey(type)) { Limits.TryAdd(type, rla); } else { Limits[type].Add(rlan); } return(this); }
/// <summary> /// specify new rate-limit for api /// </summary> /// <param name="region"> /// </param> /// <param name="type"> /// </param> /// <param name="rla"> /// pre-defined when web-server starts /// </param> public void Add(string region, LolUrlType type, RLolApiName rla) { Rates.Add(region, type, rla); }