<?php

declare(strict_types=1);

namespace Drupal\flowdrop_runtime\Event;

use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when a warning is recorded by the monitor.
 *
 * @internal
 */
class MonitoringWarningEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop_runtime.monitoring.warning';

  /**
   * Constructs a new MonitoringWarningEvent.
   *
   * @param string $warning
   *   The warning message.
   * @param string $executionId
   *   The execution ID.
   * @param array $context
   *   Additional context.
   * @param int $timestamp
   *   The event timestamp.
   */
  public function __construct(
    public readonly string $warning,
    public readonly string $executionId,
    public readonly array $context,
    public readonly int $timestamp,
  ) {}

}
