Skip to content

Commit

Permalink
Merge pull request #5 from snuna/add/status-property-conditions
Browse files Browse the repository at this point in the history
Add/status property conditions
  • Loading branch information
b3ngg committed Mar 14, 2024
2 parents f730033 + 177e1ee commit 24fa090
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/models/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ pub enum SelectCondition {
IsNotEmpty,
}

#[derive(Serialize, Debug, Eq, PartialEq, Clone)]
#[serde(rename_all = "snake_case")]
pub enum StatusCondition {
/// Only return pages where the page property value matches the provided value exactly.
Equals(String),
/// Only return pages where the page property value does not match the provided value exactly.
DoesNotEqual(String),
/// Only return pages where the page property value is empty.
#[serde(serialize_with = "serialize_to_true")]
IsEmpty,
/// Only return pages where the page property value is present.
#[serde(serialize_with = "serialize_to_true")]
IsNotEmpty,
}

#[derive(Serialize, Debug, Eq, PartialEq, Clone)]
#[serde(rename_all = "snake_case")]
pub enum MultiSelectCondition {
Expand Down Expand Up @@ -251,6 +266,7 @@ pub enum PropertyCondition {
Number(NumberCondition),
Checkbox(CheckboxCondition),
Select(SelectCondition),
Staus(StatusCondition),
MultiSelect(MultiSelectCondition),
Date(DateCondition),
People(PeopleCondition),
Expand Down

0 comments on commit 24fa090

Please sign in to comment.