-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMailSortRule.cs
48 lines (36 loc) · 1.23 KB
/
MailSortRule.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
43
44
45
46
47
48
using System.Text.Json.Serialization;
namespace MailSort;
public class MailSortRule
{
[JsonPropertyName("id")]
public string? Id { get; set; }
[JsonPropertyName("haystack")]
[JsonConverter(typeof(EnumCapitalizationConverter<Haystack>))]
public Haystack Haystack { get; set; }
[JsonPropertyName("needle")]
public string Needle { get; set; } = null!;
[JsonPropertyName("matchingMethod")]
[JsonConverter(typeof(EnumCapitalizationConverter<MatchingMethod>))]
public MatchingMethod MatchingMethod { get; set; }
[JsonPropertyName("targetFolder")]
public string TargetFolder { get; set; } = null!;
[JsonPropertyName("combineWith")]
public string? CombineWith { get; set; }
[JsonPropertyName("combinationMethod")]
[JsonConverter(typeof(EnumCapitalizationConverter<CombinationMethod>))]
public CombinationMethod CombinationMethod { get; set; }
[JsonPropertyName("isCombinationRule")]
public bool IsCombinationRule { get; set; }
}
public enum MatchingMethod
{
Contains, Equals, ContainsIgnoreCase, EqualsIgnoreCase, GreaterThanOrEqual
}
public enum CombinationMethod
{
LogicalAnd, LogicalOr
}
public enum Haystack
{
Subject, Body, Cc, Bcc, Sender, Recipients, RecipientsAndCc, RecipientsAndBcc, CcAndBcc, RecipientsAndCcAndBcc, Date
}