| | | 1 | | using System.Text.Json; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Describes an output converter without exposing its implementation. |
| | | 7 | | /// </summary> |
| | | 8 | | public sealed record OutputConverterDescriptor |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new instance of the <see cref="OutputConverterDescriptor"/> class. |
| | | 12 | | /// </summary> |
| | 35 | 13 | | public OutputConverterDescriptor( |
| | 35 | 14 | | string id, |
| | 35 | 15 | | Type sourceType, |
| | 35 | 16 | | Type resultType, |
| | 35 | 17 | | string displayName, |
| | 35 | 18 | | string? description = null, |
| | 35 | 19 | | JsonElement? settingsSchema = null) |
| | | 20 | | { |
| | 35 | 21 | | Id = id; |
| | 35 | 22 | | SourceType = sourceType; |
| | 35 | 23 | | ResultType = resultType; |
| | 35 | 24 | | DisplayName = displayName; |
| | 35 | 25 | | Description = description; |
| | 35 | 26 | | SettingsSchema = settingsSchema?.Clone(); |
| | 35 | 27 | | } |
| | | 28 | | |
| | | 29 | | /// <summary>The stable, ordinal case-sensitive converter ID.</summary> |
| | 209 | 30 | | public string Id { get; } |
| | | 31 | | |
| | | 32 | | /// <summary>The declared source type accepted by the converter.</summary> |
| | 70 | 33 | | public Type SourceType { get; } |
| | | 34 | | |
| | | 35 | | /// <summary>The declared result type produced by the converter.</summary> |
| | 75 | 36 | | public Type ResultType { get; } |
| | | 37 | | |
| | | 38 | | /// <summary>The display name exposed through discovery.</summary> |
| | 0 | 39 | | public string DisplayName { get; } |
| | | 40 | | |
| | | 41 | | /// <summary>The optional description exposed through discovery.</summary> |
| | 0 | 42 | | public string? Description { get; } |
| | | 43 | | |
| | | 44 | | /// <summary>An immutable optional JSON Schema for per-binding settings.</summary> |
| | 12 | 45 | | public JsonElement? SettingsSchema { get; } |
| | | 46 | | } |