using CryptoExchange.Net.Objects;
using System;
namespace CryptoExchange.Net.RateLimiting
{
///
/// Rate limit event
///
public record RateLimitEvent
{
///
/// Name of the API limit that is reached
///
public string ApiLimit { get; set; } = string.Empty;
///
/// Description of the limit that is reached
///
public string LimitDescription { get; set; } = string.Empty;
///
/// The request definition
///
public RequestDefinition RequestDefinition { get; set; }
///
/// The host the request is for
///
public string Host { get; set; } = default!;
///
/// The current counter value
///
public int Current { get; set; }
///
/// The weight of the limited request
///
public int RequestWeight { get; set; }
///
/// The limit per time period
///
public int? Limit { get; set; }
///
/// The time period the limit is for
///
public TimeSpan? TimePeriod { get; set; }
///
/// The time the request will be delayed for if the Behaviour is RateLimitingBehaviour.Wait
///
public TimeSpan? DelayTime { get; set; }
///
/// The handling behaviour for the rquest
///
public RateLimitingBehaviour Behaviour { get; set; }
///
/// ctor
///
///
///
///
///
///
///
///
///
///
///
public RateLimitEvent(string apiLimit, string limitDescription, RequestDefinition definition, string host, int current, int requestWeight, int? limit, TimeSpan? timePeriod, TimeSpan? delayTime, RateLimitingBehaviour behaviour)
{
ApiLimit = apiLimit;
LimitDescription = limitDescription;
RequestDefinition = definition;
Host = host;
Current = current;
RequestWeight = requestWeight;
Limit = limit;
TimePeriod = timePeriod;
DelayTime = delayTime;
Behaviour = behaviour;
}
}
}