using System;

namespace StellaOps.Feedser.Source.Ghsa.Internal;

internal readonly record struct GhsaRateLimitSnapshot(
    string Phase,
    string? Resource,
    long? Limit,
    long? Remaining,
    long? Used,
    DateTimeOffset? ResetAt,
    TimeSpan? ResetAfter,
    TimeSpan? RetryAfter)
{
    public bool HasData =>
        Limit.HasValue ||
        Remaining.HasValue ||
        Used.HasValue ||
        ResetAt.HasValue ||
        ResetAfter.HasValue ||
        RetryAfter.HasValue ||
        !string.IsNullOrEmpty(Resource);
}
