Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

60 lines
1.8 KiB

// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschraenkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.ComponentModel.DataAnnotations;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Entities.Rules.Runner;
using Squidex.Infrastructure.Reflection;
namespace Squidex.Areas.Api.Controllers.Rules.Models
{
public sealed record SimulatedRuleEventDto
{
/// <summary>
/// The name of the event.
/// </summary>
[Required]
public string EventName { get; set; }
/// <summary>
/// The source event.
/// </summary>
[Required]
public object Event { get; set; }
/// <summary>
/// The enriched event.
/// </summary>
public object? EnrichedEvent { get; set; }
/// <summary>
/// The data for the action.
/// </summary>
public string? ActionName { get; set; }
/// <summary>
/// The name of the action.
/// </summary>
public string? ActionData { get; set; }
/// <summary>
/// The name of the event.
/// </summary>
public string? Error { get; set; }
/// <summary>
/// The reason why the event has been skipped.
/// </summary>
[Required]
public SkipReason SkipReason { get; set; }
public static SimulatedRuleEventDto FromSimulatedRuleEvent(SimulatedRuleEvent ruleEvent)
{
return SimpleMapper.Map(ruleEvent, new SimulatedRuleEventDto());
}
}
}