<?php

declare(strict_types=1);

namespace Drupal\flowdrop_trigger\Enum;

/**
 * Defines the pipeline modes for trigger orchestration.
 *
 * @internal This enum is not part of the public API and may change without notice.
 */
enum PipelineMode: string {

  // Create a new pipeline for each trigger execution.
  case New = 'new';

  // Reuse an existing pipeline.
  case Reuse = 'reuse';

  // Use a single shared pipeline instance.
  case Singleton = 'singleton';

  /**
   * Gets a human-readable label for the pipeline mode.
   *
   * @return string
   *   The label.
   */
  public function label(): string {
    return match ($this) {
      self::New => 'New Pipeline',
      self::Reuse => 'Reuse Pipeline',
      self::Singleton => 'Singleton',
    };
  }

}
