public ResourceRateLimit(RateLimit core, RateLimit search) { Ensure.ArgumentNotNull(core, "core"); Ensure.ArgumentNotNull(search, "search"); Core = core; Search = search; }
public MiscellaneousRateLimit(ResourceRateLimit resources, RateLimit rate) { Ensure.ArgumentNotNull(resources, "resource"); Ensure.ArgumentNotNull(rate, "rate"); Resources = resources; Rate = rate; }
/// <summary> /// Constructs an instance of RateLimitExceededException /// </summary> /// <param name="response">The HTTP payload from the server</param> /// <param name="innerException">The inner exception</param> public RateLimitExceededException(IResponse response, Exception innerException) : base(response, innerException) { Ensure.ArgumentNotNull(response, nameof(response)); _rateLimit = response.ApiInfo.RateLimit; _severTimeDiff = response.ApiInfo.ServerTimeDifference; }
public ResourceRateLimit(RateLimit core, RateLimit search) { Ensure.ArgumentNotNull(core, nameof(core)); Ensure.ArgumentNotNull(search, nameof(search)); Core = core; Search = search; }
/// <summary> /// Allows you to clone ApiInfo /// </summary> /// <returns>A clone of <seealso cref="ApiInfo"/></returns> public ApiInfo Clone() { return(new ApiInfo(Links.Clone(), OauthScopes.Clone(), AcceptedOauthScopes.Clone(), Etag != null ? new string(Etag.ToCharArray()) : null, RateLimit != null ? RateLimit.Clone() : null, ServerTimeDifference)); }
/// <summary> /// Constructs an instance of RateLimitExceededException /// </summary> /// <param name="info"> /// The <see cref="SerializationInfo"/> that holds the /// serialized object data about the exception being thrown. /// </param> /// <param name="context"> /// The <see cref="StreamingContext"/> that contains /// contextual information about the source or destination. /// </param> protected RateLimitExceededException(SerializationInfo info, StreamingContext context) : base(info, context) { _rateLimit = info.GetValue("RateLimit", typeof(RateLimit)) as RateLimit ?? new RateLimit(new Dictionary <string, string>()); if (info.GetValue(nameof(ApiInfo.ServerTimeDifference), typeof(TimeSpan)) is TimeSpan serverTimeDiff) { _severTimeDiff = serverTimeDiff; } }
public ApiInfo(IDictionary<string, Uri> links, IList<string> oauthScopes, IList<string> acceptedOauthScopes, string etag, RateLimit rateLimit) { Ensure.ArgumentNotNull(links, "links"); Ensure.ArgumentNotNull(oauthScopes, "oauthScopes"); Links = new ReadOnlyDictionary<string, Uri>(links); OauthScopes = new ReadOnlyCollection<string>(oauthScopes); AcceptedOauthScopes = new ReadOnlyCollection<string>(acceptedOauthScopes); Etag = etag; RateLimit = rateLimit; }
public ApiInfo(IDictionary <string, Uri> links, IList <string> oauthScopes, IList <string> acceptedOauthScopes, string etag, RateLimit rateLimit) { Ensure.ArgumentNotNull(links, "links"); Ensure.ArgumentNotNull(oauthScopes, "oauthScopes"); Links = new ReadOnlyDictionary <string, Uri>(links); OauthScopes = new ReadOnlyCollection <string>(oauthScopes); AcceptedOauthScopes = new ReadOnlyCollection <string>(acceptedOauthScopes); Etag = etag; RateLimit = rateLimit; }
public ApiInfo(IDictionary <string, Uri> links, IList <string> oauthScopes, IList <string> acceptedOauthScopes, string etag, RateLimit rateLimit, TimeSpan serverTimeDifference = default) { Ensure.ArgumentNotNull(links, nameof(links)); Ensure.ArgumentNotNull(oauthScopes, nameof(oauthScopes)); Ensure.ArgumentNotNull(acceptedOauthScopes, nameof(acceptedOauthScopes)); Links = new ReadOnlyDictionary <string, Uri>(links); OauthScopes = new ReadOnlyCollection <string>(oauthScopes); AcceptedOauthScopes = new ReadOnlyCollection <string>(acceptedOauthScopes); Etag = etag; RateLimit = rateLimit; ServerTimeDifference = serverTimeDifference; }
/// <summary> /// Constructs an instance of RateLimitExceededException /// </summary> /// <param name="info"> /// The <see cref="SerializationInfo"/> that holds the /// serialized object data about the exception being thrown. /// </param> /// <param name="context"> /// The <see cref="StreamingContext"/> that contains /// contextual information about the source or destination. /// </param> protected RateLimitExceededException(SerializationInfo info, StreamingContext context) : base(info, context) { _rateLimit = info.GetValue("RateLimit", typeof(RateLimit)) as RateLimit ?? new RateLimit(new Dictionary <string, string>()); }
/// <summary> /// Constructs an instance of RateLimitExceededException /// </summary> /// <param name="response">The HTTP payload from the server</param> /// <param name="innerException">The inner exception</param> public RateLimitExceededException(IResponse response, Exception innerException) : base(response, innerException) { Ensure.ArgumentNotNull(response, "response"); _rateLimit = response.ApiInfo.RateLimit; }
protected RateLimitExceededException(SerializationInfo info, StreamingContext context) : base(info, context) { _rateLimit = info.GetValue("RateLimit", typeof(RateLimit)) as RateLimit ?? new RateLimit(new Dictionary<string, string>()); }
public RateLimitExceededException(IResponse response, Exception innerException) : base(response, innerException) { Ensure.ArgumentNotNull(response, "response"); _rateLimit = response.ApiInfo.RateLimit; }