|
| 1 | +using Newtonsoft.Json; |
| 2 | + |
| 3 | +namespace Notion.Client |
| 4 | +{ |
| 5 | + public class RollupFilter : SinglePropertyFilter |
| 6 | + { |
| 7 | + [JsonProperty("rollup")] |
| 8 | + public Condition Rollup { get; set; } |
| 9 | + |
| 10 | + public RollupFilter( |
| 11 | + string propertyName |
| 12 | + , IRollupSubPropertyFilter any = null |
| 13 | + , IRollupSubPropertyFilter none = null |
| 14 | + , IRollupSubPropertyFilter every = null |
| 15 | + , DateFilter.Condition date = null |
| 16 | + , NumberFilter.Condition number = null) |
| 17 | + { |
| 18 | + Property = propertyName; |
| 19 | + Rollup = new Condition( |
| 20 | + any, |
| 21 | + none, |
| 22 | + every, |
| 23 | + date, |
| 24 | + number |
| 25 | + ); |
| 26 | + } |
| 27 | + |
| 28 | + public class Condition |
| 29 | + { |
| 30 | + public Condition( |
| 31 | + IRollupSubPropertyFilter any = null |
| 32 | + , IRollupSubPropertyFilter none = null |
| 33 | + , IRollupSubPropertyFilter every = null |
| 34 | + , DateFilter.Condition date = null |
| 35 | + , NumberFilter.Condition number = null) |
| 36 | + { |
| 37 | + Any = any; |
| 38 | + None = none; |
| 39 | + Every = every; |
| 40 | + Date = date; |
| 41 | + Number = number; |
| 42 | + } |
| 43 | + |
| 44 | + [JsonProperty("any")] |
| 45 | + public IRollupSubPropertyFilter Any { get; set; } |
| 46 | + |
| 47 | + [JsonProperty("none")] |
| 48 | + public IRollupSubPropertyFilter None { get; set; } |
| 49 | + |
| 50 | + [JsonProperty("every")] |
| 51 | + public IRollupSubPropertyFilter Every { get; set; } |
| 52 | + |
| 53 | + [JsonProperty("date")] |
| 54 | + public DateFilter.Condition Date { get; set; } |
| 55 | + |
| 56 | + [JsonProperty("number")] |
| 57 | + public NumberFilter.Condition Number { get; set; } |
| 58 | + } |
| 59 | + } |
| 60 | +} |
0 commit comments