-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRequest.cs
42 lines (24 loc) · 953 Bytes
/
Request.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace UK.Gov.NationalArchives.Judgments.Api {
public class Request {
public string Filename { get; set; }
public byte[] Content { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public Hint? Hint { get; set; }
public Meta Meta { get; set; }
public IEnumerable<Attachment> Attachments { get; set; }
private static JsonSerializerOptions options = new JsonSerializerOptions() { PropertyNameCaseInsensitive = true };
public static Request FromJson(string json) {
return JsonSerializer.Deserialize<Request>(json, options);
}
}
public enum AttachmentType { Order, Appendix }
public class Attachment {
public string Filename { get; set; }
public byte[] Content { get; set; }
[JsonConverter(typeof(JsonStringEnumConverter))]
public AttachmentType Type { get; set; }
}
}