2023-08-06 18:55:24 +00:00
|
|
|
using System.Text.Json.Serialization;
|
2024-10-11 18:41:49 +00:00
|
|
|
using Elsa.Workflows;
|
2023-08-06 18:55:24 +00:00
|
|
|
|
|
|
|
|
namespace Elsa.Http.Models;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A binding between an HTTP status code and an activity.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class HttpStatusCodeCase
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a new instance of the <see cref="HttpStatusCodeCase"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonConstructor]
|
|
|
|
|
public HttpStatusCodeCase()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a new instance of the <see cref="HttpStatusCodeCase"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public HttpStatusCodeCase(int statusCode, IActivity activity)
|
|
|
|
|
{
|
|
|
|
|
StatusCode = statusCode;
|
|
|
|
|
Activity = activity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The HTTP status code to match.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int StatusCode { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The activity to execute when the HTTP status code matches.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IActivity? Activity { get; set; }
|
|
|
|
|
}
|