using System;
using static StellaOps.Localization.T;
namespace StellaOps.Provcache;
public sealed partial class VeriKeyBuilder
{
///
/// Sets the time window for epoch bucketing.
///
/// The time window identifier (e.g., "2024-12-24T12:00:00Z").
/// This builder for fluent chaining.
public VeriKeyBuilder WithTimeWindow(string timeWindow)
{
if (string.IsNullOrWhiteSpace(timeWindow))
throw new ArgumentException(_t("common.provcache.time_window_required"), nameof(timeWindow));
_timeWindow = timeWindow;
return this;
}
///
/// Computes time window from a timestamp using the configured bucket size.
///
/// The timestamp to bucket.
/// This builder for fluent chaining.
public VeriKeyBuilder WithTimeWindow(DateTimeOffset timestamp)
{
_timeWindow = _options.ComputeTimeWindow(timestamp);
return this;
}
}