Skip to content

Commit e9bab07

Browse files
Merge pull request #330 from JakoMenkveld/main
Added StatusFilter 🎉
2 parents dc5cf2c + 5d67e3a commit e9bab07

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public class StatusFilter : SinglePropertyFilter, IRollupSubPropertyFilter
6+
{
7+
[JsonProperty("status")]
8+
public Condition Status { get; set; }
9+
10+
public StatusFilter(
11+
string propertyName,
12+
string equal = null,
13+
string doesNotEqual = null,
14+
bool? isEmpty = null,
15+
bool? isNotEmpty = null)
16+
{
17+
Property = propertyName;
18+
Status = new Condition(
19+
equal: equal,
20+
doesNotEqual: doesNotEqual,
21+
isEmpty: isEmpty,
22+
isNotEmpty: isNotEmpty
23+
);
24+
}
25+
26+
public class Condition
27+
{
28+
[JsonProperty("equals")]
29+
public string Equal { get; set; }
30+
31+
[JsonProperty("does_not_equal")]
32+
public string DoesNotEqual { get; set; }
33+
34+
[JsonProperty("is_empty")]
35+
public bool? IsEmpty { get; set; }
36+
37+
[JsonProperty("is_not_empty")]
38+
public bool? IsNotEmpty { get; set; }
39+
40+
public Condition(
41+
string equal = null,
42+
string doesNotEqual = null,
43+
bool? isEmpty = null,
44+
bool? isNotEmpty = null)
45+
{
46+
Equal = equal;
47+
DoesNotEqual = doesNotEqual;
48+
IsEmpty = isEmpty;
49+
IsNotEmpty = isNotEmpty;
50+
}
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)