<?php

declare(strict_types=1);

namespace Drupal\flowdrop_workflow\Diagnostic\Mutation;

/**
 * Removes a single key from a node's user config (`data.config`).
 */
final class RemoveNodeConfigKey implements WorkflowMutationInterface {

  /**
   * Constructs a RemoveNodeConfigKey mutation.
   *
   * @param string $nodeId
   *   The id of the node whose config is edited.
   * @param string $key
   *   The config key to remove.
   */
  public function __construct(
    public readonly string $nodeId,
    public readonly string $key,
  ) {}

  /**
   * {@inheritdoc}
   */
  public function summary(): string {
    return sprintf('Remove config "%s" from node "%s".', $this->key, $this->nodeId);
  }

}
