| | | 1 | | using Elsa.Workflows.Api.Contracts; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Api.Endpoints.Shells; |
| | | 4 | | |
| | | 5 | | internal class ShellReloadResponse |
| | | 6 | | { |
| | 14 | 7 | | public ShellReloadStatus Status { get; init; } |
| | 14 | 8 | | public string? RequestedShellId { get; init; } |
| | 14 | 9 | | public DateTimeOffset ReloadedAt { get; init; } |
| | 21 | 10 | | public IReadOnlyCollection<ShellReloadItemResponse> Shells { get; init; } = []; |
| | | 11 | | |
| | 7 | 12 | | public static ShellReloadResponse FromResult(ShellReloadResult result) => new() |
| | 7 | 13 | | { |
| | 7 | 14 | | Status = result.Status, |
| | 7 | 15 | | RequestedShellId = result.RequestedShellId, |
| | 7 | 16 | | ReloadedAt = result.ReloadedAt, |
| | 10 | 17 | | Shells = result.Shells.Select(x => new ShellReloadItemResponse |
| | 10 | 18 | | { |
| | 10 | 19 | | ShellId = x.ShellId, |
| | 10 | 20 | | Outcome = x.Outcome, |
| | 10 | 21 | | Requested = x.Requested, |
| | 10 | 22 | | Message = x.Message |
| | 10 | 23 | | }).ToArray() |
| | 7 | 24 | | }; |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | internal class ShellReloadItemResponse |
| | | 28 | | { |
| | | 29 | | public string ShellId { get; init; } = default!; |
| | | 30 | | public ShellReloadItemOutcome Outcome { get; init; } |
| | | 31 | | public bool Requested { get; init; } |
| | | 32 | | public string? Message { get; init; } |
| | | 33 | | } |