namespace Hawkeye.VisionBuilder.Workflow.Overrides;

public class OperationOverride
{
    public string Name { get; set; }
    public string Property { get; set; }
    public object Value { get; set; }

    public void Apply(WorkflowList workflowList)
    {
        var operation = workflowList.Operations.FirstOrDefault(o => o.Label == Name);
        if (operation == null) return;
        var property = operation.GetType().GetProperty(Property);
        if (property == null) return;
        property.SetValue(operation, Value);
    }
}