namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Management;
public record ListApiMethodsCommand;
public record GetApiMethodCommand(int ApiMethodId);
/// Flow Debugger (design 2026-09-05 §5.2): trace every production call to this method. Additive; defaults to off.
public record CreateApiMethodCommand(string Name, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition, bool TraceAllCalls = false);
/// Flow Debugger (design 2026-09-05 §5.2): null leaves the stored value unchanged so an older CLI never resets it.
public record UpdateApiMethodCommand(int ApiMethodId, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition, bool? TraceAllCalls = null);
public record DeleteApiMethodCommand(int ApiMethodId);
///
/// Compiles the method's stored script on the receiving central node and returns the
/// diagnostics, without registering the handler or touching the known-bad cache
/// (ScadaBridge#75). Operators see the real compile error here; the data plane keeps
/// returning its generic message.
///
/// The API method to validate.
public record ValidateApiMethodCommand(int ApiMethodId);
///
/// Re-runs CompileAndRegister for the method's stored script on the receiving central
/// node, replacing its cached handler or known-bad record, without re-sending the entity
/// (ScadaBridge#75). Returns the diagnostics.
///
/// The API method to recompile.
public record RecompileApiMethodCommand(int ApiMethodId);