Ad default constructors to appease Swagger gen

This commit is contained in:
Sipke Schoorstra 2021-06-05 15:36:11 +02:00
parent a64675817a
commit 142d42d00c

View file

@ -1,13 +1,74 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Elsa.Services.Models;
namespace Elsa.Server.Api.Endpoints.Signals
{
public record DispatchSignalRequest(string? WorkflowInstanceId, string? CorrelationId, object? Input);
public record DispatchSignalRequest
{
// Need this for Swagger.
public DispatchSignalRequest()
{
}
public DispatchSignalRequest(string? workflowInstanceId, string? correlationId, object? input)
{
WorkflowInstanceId = workflowInstanceId;
CorrelationId = correlationId;
Input = input;
}
public record DispatchSignalResponse(ICollection<PendingWorkflow> StartedWorkflows);
public string? WorkflowInstanceId { get; init; }
public string? CorrelationId { get; init; }
public object? Input { get; init; }
}
public record ExecuteSignalRequest(string? WorkflowInstanceId, string? CorrelationId, object? Input);
public record DispatchSignalResponse
{
// Need this for Swagger.
public DispatchSignalResponse()
{
}
public DispatchSignalResponse(ICollection<PendingWorkflow> startedWorkflows)
{
StartedWorkflows = startedWorkflows;
}
public record ExecuteSignalResponse(ICollection<StartedWorkflow> StartedWorkflows);
public ICollection<PendingWorkflow> StartedWorkflows { get; init; } = default!;
}
public record ExecuteSignalRequest
{
// Need this for Swagger.
public ExecuteSignalRequest()
{
}
public ExecuteSignalRequest(string? workflowInstanceId, string? correlationId, object? input)
{
WorkflowInstanceId = workflowInstanceId;
CorrelationId = correlationId;
Input = input;
}
public string? WorkflowInstanceId { get; init; }
public string? CorrelationId { get; init; }
public object? Input { get; init; }
}
public record ExecuteSignalResponse
{
// Need this for Swagger.
public ExecuteSignalResponse()
{
}
public ExecuteSignalResponse(ICollection<StartedWorkflow> startedWorkflows)
{
StartedWorkflows = startedWorkflows;
}
public ICollection<StartedWorkflow> StartedWorkflows { get; init; } = new List<StartedWorkflow>();
}
}