Skip to content

Commit

Permalink
Merge pull request #330 from JakoMenkveld/main
Browse files Browse the repository at this point in the history
Added StatusFilter 🎉
  • Loading branch information
KoditkarVedant authored Oct 4, 2022
2 parents dc5cf2c + 5d67e3a commit e9bab07
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions Src/Notion.Client/Models/Filters/StatusFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Newtonsoft.Json;

namespace Notion.Client
{
public class StatusFilter : SinglePropertyFilter, IRollupSubPropertyFilter
{
[JsonProperty("status")]
public Condition Status { get; set; }

public StatusFilter(
string propertyName,
string equal = null,
string doesNotEqual = null,
bool? isEmpty = null,
bool? isNotEmpty = null)
{
Property = propertyName;
Status = new Condition(
equal: equal,
doesNotEqual: doesNotEqual,
isEmpty: isEmpty,
isNotEmpty: isNotEmpty
);
}

public class Condition
{
[JsonProperty("equals")]
public string Equal { get; set; }

[JsonProperty("does_not_equal")]
public string DoesNotEqual { get; set; }

[JsonProperty("is_empty")]
public bool? IsEmpty { get; set; }

[JsonProperty("is_not_empty")]
public bool? IsNotEmpty { get; set; }

public Condition(
string equal = null,
string doesNotEqual = null,
bool? isEmpty = null,
bool? isNotEmpty = null)
{
Equal = equal;
DoesNotEqual = doesNotEqual;
IsEmpty = isEmpty;
IsNotEmpty = isNotEmpty;
}
}
}
}

0 comments on commit e9bab07

Please sign in to comment.