using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Unity.Pipeline.Commands;
namespace Unity.Pipeline.Editor.Commands.Batch
{
///
/// A single operation in a batch request (AUTHAPI-27): the name of a registered command
/// plus the parameters to invoke it with, and an optional so later operations
/// can reference this one's result.
///
/// String values anywhere in may reference an earlier operation's result
/// with "$<id-or-index>.<jsonPath>" (e.g. "$0.instanceId" or
/// "$createHead.components[0].instanceId"); "$$" escapes a literal '$'.
/// References are backward-only. Implements so the batch
/// command advertises a nested object schema (via GET /api/commands) rather than a string.
///
sealed class BatchOperationInput : IStructuredCommandInput
{
///
/// Optional operation id used to reference this operation's result from a later op
/// ("$<id>.<field>"). Must be unique within the batch when supplied, and
/// must match ^[A-Za-z_][A-Za-z0-9_-]*$ — purely numeric ids would be ambiguous with
/// 0-based index selectors, and '.' collides with the reference path separator.
///
[CliArg("id", "Optional id for referencing this op's result from a later op (\"$.\"). Unique within the batch; must match ^[A-Za-z_][A-Za-z0-9_-]*$ (not purely numeric, no dots).")]
[JsonProperty("id")]
public string Id { get; set; }
/// Name of the registered command to run (any command except the excluded list).
[CliArg("command", "Name of the registered command to run.", Required = true)]
[JsonProperty("command")]
public string Command { get; set; }
///
/// Parameters for the command, same shape as /api/exec parameters. Any string
/// value may reference a prior op's result ("$<id-or-index>.<jsonPath>").
///
[CliArg("params", "Parameters for the command. String values may reference a prior op's result: \"$.\".")]
[JsonProperty("params")]
public JObject Params { get; set; }
}
}