| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Http; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Represents a downloadable object. |
| | | 7 | | /// </summary> |
| | | 8 | | public class Downloadable |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Initializes a new instance of the <see cref="Downloadable"/> class. |
| | | 12 | | /// </summary> |
| | | 13 | | [JsonConstructor] |
| | 24 | 14 | | public Downloadable() |
| | | 15 | | { |
| | 24 | 16 | | } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Initializes a new instance of the <see cref="Downloadable"/> class. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <param name="stream">The stream to download.</param> |
| | | 22 | | /// <param name="filename">The filename to use when downloading the stream.</param> |
| | | 23 | | /// <param name="contentType">The content type to use when downloading the stream.</param> |
| | | 24 | | /// <param name="eTag">The ETag to use when downloading the stream.</param> |
| | 0 | 25 | | public Downloadable(Stream stream, string? filename = default, string? contentType = default, string? eTag = default |
| | | 26 | | { |
| | 0 | 27 | | Stream = stream; |
| | 0 | 28 | | Filename = filename; |
| | 0 | 29 | | ContentType = contentType; |
| | 0 | 30 | | ETag = eTag; |
| | 0 | 31 | | } |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// The stream to download. |
| | | 35 | | /// </summary> |
| | 47 | 36 | | public Stream Stream { get; set; } = default!; |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// The filename to use when downloading the stream. |
| | | 40 | | /// </summary> |
| | 35 | 41 | | public string? Filename { get; set; } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// The content type to use when downloading the stream. |
| | | 45 | | /// </summary> |
| | 47 | 46 | | public string? ContentType { get; set; } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// The ETag to use when downloading the stream. |
| | | 50 | | /// </summary> |
| | 21 | 51 | | public string? ETag { get; set; } |
| | | 52 | | } |