using System.Threading; using System.Threading.Tasks; namespace RudderSdk.Core; /// Session of a scenario notification node. public sealed class NotificationSession { internal NotificationSession(ScenarioNodeContext context) => Context = context; /// Underlying node context. public ScenarioNodeContext Context { get; } /// Node id. public string Id => Context.NodeId; /// Reads a typed value from the node data. public T Get(string key, T defaultValue = default!) => Context.Get(key, defaultValue); /// Advances the run through the output handle. public Task CompleteAsync(CancellationToken cancellationToken = default) => Context.CompleteAsync("output", cancellationToken); /// Advances the run through the output handle (fire-and-forget). public void Complete() => Context.Complete("output"); }