|
1 | 1 | using System.Text.Json;
|
2 | 2 | using System.Text.Json.Serialization;
|
| 3 | +using DotNut.JsonConverters; |
3 | 4 |
|
4 | 5 | namespace DotNut.ApiModels;
|
5 | 6 |
|
6 | 7 | public class GetInfoResponse
|
7 | 8 | {
|
8 |
| - [JsonPropertyName("name")] public string Name { get; set; } |
9 |
| - [JsonPropertyName("pubkey")] public string Pubkey { get; set; } |
10 |
| - [JsonPropertyName("version")] public string Version { get; set; } |
11 |
| - [JsonPropertyName("description")] public string Description { get; set; } |
12 |
| - [JsonPropertyName("description_long")] public string DescriptionLong { get; set; } |
13 |
| - [JsonPropertyName("contact")] public List<ContactInfo> Contact { get; set; } |
14 |
| - [JsonPropertyName("motd")] public string Motd { get; set; } |
15 |
| - [JsonPropertyName("nuts")] public Dictionary<string, JsonDocument> Nuts { get; set; } |
| 9 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 10 | + [JsonPropertyName("name")] |
| 11 | + public string? Name { get; set; } |
| 12 | + |
| 13 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 14 | + [JsonPropertyName("pubkey")] |
| 15 | + public string? Pubkey { get; set; } |
| 16 | + |
| 17 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 18 | + [JsonPropertyName("version")] |
| 19 | + public string? Version { get; set; } |
| 20 | + |
| 21 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 22 | + [JsonPropertyName("description")] |
| 23 | + public string? Description { get; set; } |
| 24 | + |
| 25 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 26 | + [JsonPropertyName("description_long")] |
| 27 | + public string? DescriptionLong { get; set; } |
| 28 | + |
| 29 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 30 | + [JsonPropertyName("contact")] |
| 31 | + public List<ContactInfo>? Contact { get; set; } |
| 32 | + |
| 33 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 34 | + [JsonPropertyName("motd")] |
| 35 | + public string? Motd { get; set; } |
| 36 | + |
| 37 | + |
| 38 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 39 | + [JsonPropertyName("icon_url")] |
| 40 | + public string? IconUrl { get; set; } |
| 41 | + |
| 42 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 43 | + [JsonConverter(typeof(UnixDateTimeOffsetConverter))] |
| 44 | + [JsonPropertyName("time")] |
| 45 | + public DateTimeOffset? Time { get; set; } |
| 46 | + |
| 47 | + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] |
| 48 | + [JsonPropertyName("nuts")] |
| 49 | + public Dictionary<string, JsonDocument>? Nuts { get; set; } |
16 | 50 | }
|
17 | 51 |
|
18 | 52 | public class ContactInfo
|
|
0 commit comments