<?php

declare(strict_types=1);

namespace Drupal\flowdrop\DTO\Reason;

/**
 * The model / operation-type choices a reasoning backend offers.
 *
 * Capability discovery so a core reasoning node can populate its own config
 * schema (the Model enum and the operation-type / role options) WITHOUT
 * importing a backend service. A backend with no models configured returns an
 * empty set, and the node degrades to free-text fields.
 *
 * @api
 */
final class ModelChoices {

  /**
   * Constructs a ModelChoices.
   *
   * @param array<int, string> $models
   *   Available explicit model ids.
   * @param string|null $defaultModel
   *   The default model id, if any.
   * @param array<int, array{value: string, label: string}> $operationTypeOptions
   *   The operation-type / model-role options ({value, label}).
   */
  public function __construct(
    private readonly array $models = [],
    private readonly ?string $defaultModel = NULL,
    private readonly array $operationTypeOptions = [],
  ) {}

  /**
   * The available explicit model ids.
   *
   * @return array<int, string>
   *   The model ids.
   */
  public function getModels(): array {
    return $this->models;
  }

  /**
   * The default model id.
   *
   * @return string|null
   *   The default model id, or NULL if none.
   */
  public function getDefaultModel(): ?string {
    return $this->defaultModel;
  }

  /**
   * The operation-type / model-role options.
   *
   * @return array<int, array{value: string, label: string}>
   *   Each option is {value, label}.
   */
  public function getOperationTypeOptions(): array {
    return $this->operationTypeOptions;
  }

}
