public bool ContainsApiName(LolApiName name, LolApiMethodName method) { bool q1 = ApiMethods.Contains(method); bool q2 = Names.Contains(name); return(q1 && q2); }
public LolApiUrl PostMethod(LolApiMethodName middleType, Type returnType, Type bodyValueType, bool IsBodyRequired, params LolApiPath[] subApis) { this.ApiMethods.Add(new LolApiMethod(middleType, subApis, returnType, ApiMethodType.Post, bodyValueType, IsBodyRequired)); this.LastApiMethodIndex = this.ApiMethods.Count - 1; return(this); }
public LolApiUrl PutMethod(LolApiMethodName methodName, Type bodyValueType, bool IsBodyRequired, params LolApiPath[] subApis) { this.ApiMethods.Add(new LolApiMethod(methodName, subApis, typeof(int), ApiMethodType.Put, bodyValueType, IsBodyRequired)); this.LastApiMethodIndex = this.ApiMethods.Count - 1; return(this); }
public LolApiMethod(LolApiMethodName md, LolApiPath[] array, Type returnValueType, ApiMethodType requestType) { this.ApiMethodName = md; this.RiotGamesApiPaths = array ?? new LolApiPath[0]; ReturnValueType = returnValueType; TypesOfQueryParameter = new Dictionary <string, Type>(); RequestType = requestType; }
/// <exception cref="KeyNotFoundException"> /// The property is retrieved and <paramref name="key" /> does not exist in the collection. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="key" /> is null. /// </exception> public RLolApiMethodName Find(string region, LolUrlType type, LolApiName name, LolApiMethodName method) { var rut = Find(region); var rla = rut?.Find(type); var rlan = rla?.Find(name, method); return(rlan); }
public RLolApiMethodName FindRate(string platform, LolUrlType type, LolApiName apiName, LolApiMethodName method) { return(Rates.Find(platform, type, apiName, method)); }
/// <summary> /// get data from Retry-After /// </summary> /// <param name="prop"> /// </param> /// <param name="name"> /// </param> /// <param name="limitType"> /// </param> /// <param name="retryAfterSeconds"> /// value of Retry-After /// </param> /// <param name="region"> /// </param> /// <param name="type"> /// </param> /// <exception cref="RiotGamesApiException"> /// Condition. /// </exception> public void SetRetryTime(string region, LolUrlType type, LolApiName name, RateLimitType limitType, LolApiMethodName method, int retryAfterSeconds) { var regionLimit = Rates.Find(region, type, name, method); if (regionLimit == null) { throw new RiotGamesApiException($"Undefined {limitType} limit type for region:{region},type:{type},name:{name}"); } regionLimit.RetryAfter = DateTime.Now.AddSeconds(retryAfterSeconds); regionLimit.UsedRateLimitType = limitType; }
public RLolApiMethodName Find(LolApiName name, LolApiMethodName method) { return(Names.FirstOrDefault <RLolApiMethodName>(p => p.ContainsApiName(name, method))); }
public LolApiMethod(LolApiMethodName md, LolApiPath[] array, Type returnValueType, ApiMethodType requestType, Type _bodyValueType, bool _isBodyRequired) : this(md, array, returnValueType, requestType) { BodyValueType = _bodyValueType; IsBodyRequired = _isBodyRequired; }
public LolApiUrl GetMethod(LolApiMethodName middleType, Type returnType, params LolApiPath[] subApis) { this.ApiMethods.Add(new LolApiMethod(middleType, subApis, returnType, ApiMethodType.Get)); this.LastApiMethodIndex = this.ApiMethods.Count - 1; return(this); }