using System;
using Newtonsoft.Json.Linq;
namespace RudderSdk.Core;
/// A scenario wait node. The run resumes when the server advances it at .
public sealed class WaitEffect
{
private readonly EffectHandle _handle;
internal WaitEffect(EffectHandle handle, DateTimeOffset deadlineUtc)
{
_handle = handle;
DeadlineUtc = deadlineUtc;
}
/// Run id.
public string RunId => _handle.RunId;
/// Scenario id.
public string ScenarioId => _handle.ScenarioId;
/// Node id.
public string NodeId => _handle.NodeId;
/// When the wait ends (UTC).
public DateTimeOffset DeadlineUtc { get; }
/// Node data payload.
public JObject Data => _handle.Data;
/// Reads a typed value from the node data.
public T Get(string key, T defaultValue = default!) => _handle.Get(key, defaultValue);
}