8000 Add StatusFilter · Issue #329 · notion-dotnet/notion-sdk-net · GitHub
[go: up one dir, main page]

Skip to content
Add StatusFilter #329
Closed
Closed
@JakoMenkveld

Description

@JakoMenkveld

Please add a StatusFilter to allow filtering on properties of type "Status":

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;
			}
		}
	}
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0