| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | using Elsa.Workflows.Attributes; |
| | | 3 | | |
| | | 4 | | namespace Elsa.Http.Bookmarks; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// A bookmark used by the <see cref="HttpEndpoint"/> activity. |
| | | 8 | | /// </summary> |
| | | 9 | | public record HttpEndpointBookmarkPayload |
| | | 10 | | { |
| | | 11 | | private readonly string _path = default!; |
| | | 12 | | private readonly string _method = default!; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Initializes a new instance of the <see cref="HttpEndpointBookmarkPayload"/> class. |
| | | 16 | | /// </summary> |
| | | 17 | | [JsonConstructor] |
| | 92 | 18 | | public HttpEndpointBookmarkPayload() |
| | | 19 | | { |
| | 92 | 20 | | } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes a new instance of the <see cref="HttpEndpointBookmarkPayload"/> class. |
| | | 24 | | /// </summary> |
| | 279 | 25 | | public HttpEndpointBookmarkPayload(string path, string method, bool? authorize = default, string? policy = default, |
| | | 26 | | { |
| | 279 | 27 | | Path = path; |
| | 279 | 28 | | Method = method; |
| | 279 | 29 | | Authorize = authorize; |
| | 279 | 30 | | Policy = policy; |
| | 279 | 31 | | RequestTimeout = requestTimeout; |
| | 279 | 32 | | RequestSizeLimit = requestSizeLimit; |
| | 279 | 33 | | } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets or sets the path of the HTTP endpoint. |
| | | 37 | | /// </summary> |
| | | 38 | | public string Path |
| | | 39 | | { |
| | 882 | 40 | | get => _path; |
| | 371 | 41 | | init => _path = value.ToLowerInvariant(); |
| | | 42 | | } |
| | | 43 | | |
| | | 44 | | /// <summary> |
| | | 45 | | /// Gets or sets the HTTP method of the endpoint. |
| | | 46 | | /// </summary> |
| | | 47 | | public string Method |
| | | 48 | | { |
| | 790 | 49 | | get => _method; |
| | 371 | 50 | | init => _method = value.ToLowerInvariant(); |
| | | 51 | | } |
| | | 52 | | |
| | | 53 | | /// <summary> |
| | | 54 | | /// Gets or sets the policy to use for authorization. |
| | | 55 | | /// </summary> |
| | 784 | 56 | | [ExcludeFromHash] public string? Policy { get; set; } |
| | | 57 | | |
| | | 58 | | /// <summary> |
| | | 59 | | /// Gets or sets a value indicating whether the endpoint requires authorization. |
| | | 60 | | /// </summary> |
| | 1090 | 61 | | [ExcludeFromHash] public bool? Authorize { get; set; } |
| | | 62 | | |
| | | 63 | | /// <summary> |
| | | 64 | | /// Gets or sets the request timeout. |
| | | 65 | | /// </summary> |
| | 998 | 66 | | [ExcludeFromHash] public TimeSpan? RequestTimeout { get; set; } |
| | | 67 | | |
| | | 68 | | /// <summary> |
| | | 69 | | /// Gets or sets the max request size in bytes. |
| | | 70 | | /// </summary> |
| | 784 | 71 | | [ExcludeFromHash] public long? RequestSizeLimit { get; set; } |
| | | 72 | | } |